TsgcWebSocketLoadBalancerServer › Events › OnError
Fires when the load balancer detects an error on one of its accepted connections.
property OnError: TsgcWSErrorEvent;
// TsgcWSErrorEvent = procedure(Connection: TsgcWSConnection; const Error: string) of object
—
OnError is raised for non-fatal errors detected while handling a connection: malformed frames, protocol violations, failures during forwarding to a backend, or I/O errors reported by the Indy layer. Connection is the affected session (may be a client or a backend connection) and Error contains a human-readable description. Use the event for logging and metrics; use OnException when you need access to the actual exception object.
procedure OnError(Connection: TsgcWSConnection; const Error: string);
begin
Log('Error on ' + Connection.Guid + ': ' + Error);
end;