TsgcWSPServer_PresenceEvents › OnException

OnException Event

Fired when an unhandled exception is caught while processing a Presence message.

Syntax

property OnException: TsgcExceptionEvent;
// TsgcExceptionEvent = procedure(Connection: TsgcWSConnection; E: Exception) of object

Default Value

Remarks

Raised whenever an exception is thrown inside the server while handling a Presence frame or calling one of your event handlers. Use this event to log or recover from errors without tearing down the connection.

Example

procedure TForm1.sgcWSPServer_Presence1Exception(Connection: TsgcWSConnection;
  E: Exception);
begin
  Log('#Exception ' + Connection.Guid + ': ' + E.Message);
end;

Back to Events