TsgcWebSocketProxyServer › Events › OnError
Fires whenever a WebSocket protocol error occurs on a downstream client connection handled by the proxy.
property OnError: TsgcWSErrorEvent;
// TsgcWSErrorEvent = procedure(Connection: TsgcWSConnection; const Error: string) of object
—
OnError reports protocol-level problems detected by the WebSocket layer on a downstream client connection, such as a mal-formed handshake, an invalid frame, an unsupported opcode, or an invalid UTF-8 payload when Options.ValidateUTF8 is enabled. The Error parameter contains a textual description and the Connection parameter identifies the offending session. Errors raised on the upstream TCP link are reported through OnException instead; for unhandled runtime exceptions (socket failures, access violations...) use OnException as well.
procedure OnError(Connection: TsgcWSConnection; const Error: string);
begin
WriteLn('#error on ' + Connection.Guid + ': ' + Error);
end;