W3C home > Mailing lists > Public > public-webrtc@w3.org > December 2012

Error Handling (Section 4.6)

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Wed, 12 Dec 2012 08:25:06 +0100
Message-ID: <50C83152.10503@ericsson.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Hi

Some quoted spec text:

> An exception must be thrown in the following cases:
>  * The type of any argument passed to a function did not match what was expected. An appropriate string from the RTCExceptionName enum must be used as the error name.

> enum RTCExceptionName {
>     "INVALID_SUCCESS_CALLBACK",
>     "INVALID_FAILURE_CALLBACK",
>     "INVALID_CONSTRAINTS_TYPE",
>     "INVALID_SESSION_DESCRIPTION_TYPE",
>     "INVALID_CONFIGURATION_TYPE",
>     "INVALID_CANDIDATE_TYPE",
>     "INVALID_MEDIASTREAM",
>     "INVALID_MEDIASTREAM_TRACK",
>     "INVALID_STATE"
> };

I find the spec text about handling arguments with invalid types 
redundant. The argument translation defined by WebIDL should take care 
of this for us and throw a type error when appropriate.

/Adam
Received on Wednesday, 12 December 2012 07:25:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 12 December 2012 07:25:34 GMT