TsgcHTTPServer › Events › OnError
Fires whenever a protocol-level error occurs while processing a client connection, such as a mal-formed HTTP request.
property OnError: TsgcWSErrorEvent;
// TsgcWSErrorEvent = procedure(Connection: TsgcWSConnection; const Error: string) of object
—
OnError reports protocol-level problems detected while parsing a client connection, such as a mal-formed request line or an invalid header. The Error parameter contains a textual description and the Connection parameter identifies the offending session. Errors raised while dispatching HTTP requests from OnCommandGet / OnCommandOther are routed through OnException; OnError is reserved for the connection/protocol-parsing side of the server.
procedure OnError(Connection: TsgcWSConnection; const Error: string);
begin
WriteLn('#error on ' + Connection.Guid + ': ' + Error);
end;