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

[Bug 26517] Methods that return promises are unable to throw exceptions

From: <bugzilla@jessica.w3.org>
Date: Thu, 14 Aug 2014 20:32:21 +0000
To: public-script-coord@w3.org
Message-ID: <bug-26517-3890-AHlMOHmZ2c@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26517

--- Comment #13 from Ian 'Hixie' Hickson <ian@hixie.ch> ---
> If we get some in-between option, like "[throwOnInvalidInput]" or whatever,
> then some APIs might use this and others might not... then, as an author, you
> always need to check the API contract (so to wrap in try/catch)

No, you don't. Nobody puts every method call in a try-catch today, just like
nobody is going to be checking for a rejection on a promise for this kind of
bug.

As a developer you never need to look at what the API will do when you use it
incorrectly. You only need to use it correctly.

When you use it incorrectly, you should get an exception, the same way as when
you call the wrong API.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 14 August 2014 20:32:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC