W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2014

[Bug 25048] consider whether an IDL attribute of type Promise<T> should catch exceptions and wrap them up as a rejected Promise like they are for operations

From: <bugzilla@jessica.w3.org>
Date: Fri, 14 Mar 2014 02:24:38 +0000
To: public-script-coord@w3.org
Message-ID: <bug-25048-3890-fTLefvPX3K@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25048

Domenic Denicola <domenic@domenicdenicola.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |domenic@domenicdenicola.com

--- Comment #2 from Domenic Denicola <domenic@domenicdenicola.com> ---
In general, anytime someone is expecting to interface with an asynchronous API,
they are expecting asynchronous errors, which are caught via `.catch(e =>
...)`. It is very surprising if a synchronous error is thrown. If an API is
known to cause both types of errors, you need both `.catch(e => ...)` and
`catch(e) { ... }`, which is frustrating.

So yes, I think this change would make sense. I'm not sure under what
situations it would get triggered---how exception-prone are the operations
performed by getters, usually?---but philosophically, it's definitely
desirable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 14 March 2014 02:24:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:51 UTC