Re: [Bug 25788] New: Spec should explicitly specify whether the return types can be nullable or not.

On 05/18/2014 04:33 PM, bugzilla@jessica.w3.org wrote:
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=25788
>
>              Bug ID: 25788
>             Summary: Spec should explicitly specify whether the return
>                      types can be nullable or not.
>             Product: WebRTC Working Group
>             Version: unspecified
>            Hardware: All
>                  OS: All
>              Status: NEW
>            Severity: normal
>            Priority: P2
>           Component: Media Capture and Streams
>            Assignee: public-media-capture@w3.org
>            Reporter: kiran.guduru@samsung.com
>                  CC: public-media-capture@w3.org
>
> The return types of certain function may be null in certain scenarios.
> This has been specified for getTrackById
> "Return type: MediaStreamTrack, nullable",
> but missed to specify for other functions. This should be specified for all the
> possible cases
>
> clone - should return null in case of any error occurred while processing.
> and may be for other functions like
> getCapabilities, getConstraints, getSettings etc.
>
<contributor hat on>
I think I disagree.

If errors occur during processing, an exception should be thrown, and 
the returned value is irrelevant.

The other get* functions mentioned should also never have a null result 
value - either they succeed, returning something, or they fail 
catastrophically, in which case the return value is irrelevant.

Received on Tuesday, 1 July 2014 09:09:59 UTC