TsgcWSPClient_DatasetEvents › OnRPCError

OnRPCError Event

Fires when the server returns an error response to an RPC request.

Syntax

property OnRPCError: TsgcWSRPCErrorEvent;
// TsgcWSRPCErrorEvent = procedure(Connection: TsgcWSConnection; Id: string; ErrorCode: integer; ErrorMessage, ErrorData: string) of object

Default Value

Remarks

Id matches the value that was passed to RPC. ErrorCode is the numeric code returned by the server, ErrorMessage the short description and ErrorData optional extended information (typically JSON). The pending entry is removed from the RPC list automatically.

Example

procedure TForm1.oProtocolRPCError(Connection: TsgcWSConnection; Id: string;
  ErrorCode: integer; ErrorMessage, ErrorData: string);
begin
  Memo1.Lines.Add(Format('rpc %s error %d: %s', [Id, ErrorCode, ErrorMessage]));
end;

Back to Events