W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2016

[mediacapture-image] Rejecting promises vs throwing

From: Dan Dascalescu via GitHub <sysbot+gh@w3.org>
Date: Tue, 11 Oct 2016 22:49:00 +0000
To: public-media-capture@w3.org
Message-ID: <issues.opened-182394057-1476226137-sysbot+gh@w3.org>
dandv has just created a new issue for 

== Rejecting promises vs throwing ==
After [the change from ImageCaptureError to 
(which has "also rewritten the 4 method's descriptions to be more 
Promise-based and homogeneous"), I'd have to update [the 
polyfill](https://github.com/dandv/imagecapture) to throw a new 
`DOMException` if the stream is not `live`, but reject in case of 
other operational errors.

Any reason for this inconsistency which goes again [common 

> For operational errors, each function should support exactly one way
 of signaling errors. For Promise-based functions that means not 
mixing rejections and exceptions, which is the same as saying that 
they shouldn’t throw exceptions.

Please view or discuss this issue at 
https://github.com/w3c/mediacapture-image/issues/94 using your GitHub 
Received on Tuesday, 11 October 2016 22:49:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:37 UTC