Issue #26: Error handling

This issue has been open for a while.     Here is a proposal for resolving it. 

1. Add an onerror event to the RTCDTlsTransport object, as follows: 

[Constructor(optional RTCIceTransport transport)]
interface RTCDtlsTransport {
                attribute RTCIceTransport       transport;
    readonly    attribute RTCDtlsTransportState state;
    RTCDtlsParameters  getLocalParameters ();
    RTCDtlsParameters? getRemoteParameters ();
    void               start (RTCDtlsParameters remoteParameters);
    void               stop ();
                attribute EventHandler?         onstatechange;
                attribute EventHandler?         onerror;
};

interface onerror : Event {
    readonly    attribute DOMError e;
};

2.  Add an onerror event to the RTCDataChannel interface (this is already supported in WebRTC 1.0).  

On reviewing the rest of the specification,  it wasn't obvious that other modifications were needed.  For example: 

a. The RTCIceTransport object has an ongatherfailure event.  This seemed like the most common error, so it wasn't clear that an onerror event was needed in addition; 
b. The RTCIceListener and RTCRtpListener objects are simple enough that an onerror event doesn't seem needed; 
c.  Errors in SCTP transport establishment will presumably surface via the RTCDataChannel.onerror event,  so that an onerror event wouldn't be needed for the RTCSctpDataTransport object; 
d. The Stats API supports an error callback (although it isn't clear to me when this would fire), and this is probably sufficient. 

Received on Friday, 25 April 2014 21:35:03 UTC