TsgcRTCPeerConnection › Events › OnRTCException
Fired when an exception is raised inside the peer-connection pipeline.
property OnRTCException: TsgcRTCExceptionEvent;
// TsgcRTCExceptionEvent = procedure(Sender: TObject; E: Exception) of object
—
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.
procedure TForm1.oRTCException(Sender: TObject; E: Exception);
begin
Log(Format('RTC error [%s]: %s', [E.ClassName, E.Message]));
end;