Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnAsyncError #6

Open
GoogleCodeExporter opened this issue Mar 21, 2015 · 0 comments
Open

OnAsyncError #6

GoogleCodeExporter opened this issue Mar 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

this works
procedure OnAsyncSuccess(r: IRESTResponse);
var
  ed: TovEmoData;
  e: TovEmo;
begin
  try
    ed := Mapper.JSONObjectToObject<TovEmoData>(r.BodyAsJsonObject);

    e := TovEmo.Create(ed);
    try
      Form1.memo_log.Lines.Text := IntToStr(e.Visi_Id) + '.' + e.Emo_Note;
    finally
      e.Free
    end;

    ed.Free;
  except
    ShowMessage('error')
  end;
end;

procedure OnAsyncError(e: Exception);
begin
  ShowMessage('error');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  RESTClient.Asynch(OnAsyncSuccess, OnAsyncError, nil, true).doGET('/emo', ['285063'])
end;

this does not work
procedure OnAsyncSuccess(r: IRESTResponse);
var
  ed: TovEmoData;
  e: TovEmo;
begin
  try
    ed := Mapper.JSONObjectToObject<TovEmoData>(r.BodyAsJsonObject);

    e := TovEmo.Create(ed);
    try
      Form1.memo_log.Lines.Text := IntToStr(e.Visi_Id) + '.' + e.Emo_Note;
    finally
      e.Free
    end;

    ed.Free;
  except
    ShowMessage('error')
  end;
end;

procedure OnAsyncError(e: Exception);
begin
  ShowMessage(e.message);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  RESTClient.Asynch(OnAsyncSuccess, OnAsyncError, nil, true).doGET('/emo', ['285063'])
end;

only the procedure OnAsyncError is different

Original issue reported on code.google.com by [email protected] on 28 Aug 2014 at 8:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant