TsgcWSPServer_WebRTCEvents › OnException

OnException Event

Fires when a Delphi exception is raised inside the server's worker threads or user event handlers.

Syntax

property OnException: TsgcExceptionEvent;
// TsgcExceptionEvent = procedure(Connection: TsgcWSConnection; E: Exception) of object

Default Value

Remarks

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.

Example


procedure TForm1.WebRTCServerException(Connection: TsgcWSConnection;
  E: Exception);
begin
  Memo1.Lines.Add(Format('[%s] exception: %s - %s',
    [Connection.Guid, E.ClassName, E.Message]));
end;

Back to Events