TsgcRTCPeerConnectionEvents › OnRTCException

OnRTCException Event

Fired when an exception is raised inside the peer-connection pipeline.

Syntax

property OnRTCException: TsgcRTCExceptionEvent;
// TsgcRTCExceptionEvent = procedure(Sender: TObject; E: Exception) of object

Default Value

Remarks

Raised when an exception is caught inside any of the internal stacks (ICE agent, STUN/TURN client, DTLS, signalling client or data channel). The E parameter holds the original exception object; inspect its ClassName and Message to distinguish errors such as TURN authentication failures, DTLS handshake errors or socket issues. This event lets you report the failure to the user without the exception propagating out of the callback thread.

Example

procedure TForm1.oRTCException(Sender: TObject; E: Exception);
begin
  Log(Format('RTC error [%s]: %s', [E.ClassName, E.Message]));
end;

Back to Events