Error handling

The current specification indicates that INVALID_STATE_ERR exceptions may be
thrown if methods are called on a PeerConnection that is in the wrong state.
However, other sorts of errors can of course occur:
- a bad object (i.e. not a MediaStream) is passed to addStream
- processSignalingMessage receives an malformed signaling blob
- processSignalingMessage receives an incompatible description (no codecs,
incompatible codecs, incompatible crypto)
- an internal failure occurs while processing an arbitrary API call
- connectivity fails to establish, or is lost mid-call

I think we may need to document/define some additional exception types, as
well as some sort of async onerror callback to indicate a fatal session
failure. I see that DOMException defines a SYNTAX_ERR which could be used
for the malformed blob case, but is there something else that can be used
for general internal errors?

Received on Friday, 2 September 2011 22:16:02 UTC