TsgcWebSocketLoadBalancerServer › Events › OnException
Fires when an unhandled Delphi exception is caught by the load balancer while processing a connection.
property OnException: TsgcExceptionEvent;
// TsgcExceptionEvent = procedure(Connection: TsgcWSConnection; E: Exception) of object
—
OnException is raised when an exception propagates out of the internal dispatch pipeline, typically from a user event handler, from the forwarder, or from the underlying Indy I/O code. Connection is the affected session and E is the exception instance; the exception is swallowed by the server after the event returns so the connection thread can continue servicing other requests. Read E.ClassName and E.Message for logging; do not re-raise.
procedure OnException(Connection: TsgcWSConnection; E: Exception);
begin
Log(Format('Exception %s on %s: %s',
[E.ClassName, Connection.Guid, E.Message]));
end;