Have you explored the newest version of the OpenTok platform? Check out OpenTok 2.0, built on top of WebRTC. Learn more

ExceptionEvent class

The TB object dispatches exception events when the TokBox API encounters an exception (error). The ExceptionEvent object defines the properties of the event object that is dispatched.

Note that you set up an event handler for the exception event by calling the TB.addEventListener() method, which is a static method.

ExceptionEvent properties

The ExceptionEvent object has the following properties:

code (Number) — The error code.

The following is a partial list of error codes:

code title
1000 Failed To Load
1004 Authentication error
1005 Invalid Session ID
1006 Connect Failed
1007 Connect Rejected
1008 Connect Time-out
1009 Security Error
1010 Not Connected
1011 Invalid Parameter
1013 Peer-to-peer Connection Failed
1014 API Response Failure
1500 Unable to Publish
1510 Unable to Signal
1520 Unable to Force Disconnect
1530 Unable to Force Unpublish
1535 Force Unpublish on Invalid Stream
2000 Internal Error
2001 Embed Failed
2010 Report Issue Failure
3002 Playback stop exception
3003 Playback start exception
3004 Record start exception
3005 Record stop exception
3007 Session recording in progress

Check the message property for more details about the error.

message (String) — The error message.

target (Object) — The object that dispatched the event.

title (Number) — The error title.

type (String) — The type of event ("exception").

See

TB.addEventListener()

IRC Live Chat

Have a quick question? Chat with TokBox Support on IRC. Join chat