TsgcWSPServer_WebRTC › Events › OnException
Fires when a Delphi exception is raised inside the server's worker threads or user event handlers.
property OnException: TsgcExceptionEvent;
// TsgcExceptionEvent = procedure(Connection: TsgcWSConnection; E: Exception) of object
—
Central hook for exceptions that would otherwise terminate a listener or dispatcher thread silently — for example a bug in an OnBeforeSubscription handler or an OS-level failure during TLS. The component catches the exception and forwards it here so the application can log the class name and message. Protocol-level conditions surfaced as plain strings go through OnError instead.
procedure TForm1.WebRTCServerException(Connection: TsgcWSConnection;
E: Exception);
begin
Memo1.Lines.Add(Format('[%s] exception: %s - %s',
[Connection.Guid, E.ClassName, E.Message]));
end;