TsgcWSPClient_sgc › Events › OnRPCError
Fires when the server returns an error response to an RPC request.
property OnRPCError: TsgcWSRPCErrorEvent;
// TsgcWSRPCErrorEvent = procedure(Connection: TsgcWSConnection; Id: string; ErrorCode: integer; ErrorMessage, ErrorData: string) of object
—
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.
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;