TsgcWebSocketClient › Events › OnError
Fires every time a WebSocket protocol error occurs on the connection.
property OnError: TsgcWSErrorEvent;
// TsgcWSErrorEvent = procedure(Connection: TsgcWSConnection; const Error: string) of object
—
OnError reports protocol-level problems detected by the WebSocket layer, such as an invalid message type, a malformed frame, or an invalid UTF-8 payload when Options.ValidateUTF8 is enabled. The Error parameter contains a textual description of the failure; the Connection parameter identifies the affected session. For unhandled exceptions (socket errors, access violations...) use OnException instead. This event does not close the connection by itself.
procedure OnError(Connection: TsgcWSConnection; const Error: string);
begin
WriteLn('#error: ' + Error);
end;