TsgcWSPClient_sgcEvents › OnRPCError

OnRPCError Evento

Si attiva quando il server restituisce una risposta di errore a una richiesta RPC.

Sintassi

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

Valore predefinito

Note

Id corrisponde al valore passato all'RPC. ErrorCode è il codice numerico restituito dal server, ErrorMessage la breve descrizione ed ErrorData le informazioni estese facoltative (tipicamente JSON). La voce in sospeso viene rimossa automaticamente dall'elenco RPC.

Esempio

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;

Torna agli Eventi