W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2013

Re: addIceCandidate needs an error callback

From: Harald Alvestrand <harald@alvestrand.no>
Date: Fri, 03 May 2013 15:18:28 +0200
Message-ID: <5183B924.60308@alvestrand.no>
To: public-webrtc@w3.org
On 05/02/2013 08:59 PM, Eric Rescorla wrote:
> The spec says about addIceCandidate()
>
> An exception with an |RTCError| object of type 
> |INVALID_CANDIDATE_TYPE| is thrown if candidate parameter is malformed.
>
> I believe this doesn't match with our agreed error handling principles:
>
> Say I add a candidate with a bogus candidate string (e.g., a missing 
> "typ" field or something).
>
> Like malformed SDP, this should be handled with an error callback.
>
> -Ekr
>
It would also be consistent with our error handling principles to throw 
a TypeError exception; in fact I made the specific recommendation to 
replace INVALID_CANDIDATE_TYPE with TypeError in the spec.

If we have an error callback, I'd also think we need a success callback, 
on the symmetry principle of always knowing whether or not a call 
succeeded; that's a lot of machinery.

Are there specific reasons why you'd prefer an error callback?
Received on Friday, 3 May 2013 13:18:58 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:33 UTC