Re: addIceCandidate needs an error callback

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