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: Tue, 05 Aug 2014 18:25:17 +0000
To: public-script-coord@w3.org
Message-ID: <bug-26517-3890-el7LaJ0Cvg@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26517

Ian 'Hixie' Hickson <ian@hixie.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian@hixie.ch

--- Comment #7 from Ian 'Hixie' Hickson <ian@hixie.ch> ---
If you read over [1], you will see plenty of justification as to why having
only one mode of error handling is a bad idea too. Let's not pretend that
there's any kind of consensus on this issue, either. Plenty of people commented
on that issue in agreement with the idea that we shouldn't turn type checks
into promise rejections.

All this bug is asking for is the ability to write IDL without having to have
hacks to sidestep this exception-wrapping nonsense. I would much rather be able
to write:

   Promise<Foo> bar();

...than have to write:

   interface Whatever { };
   typedef (Promise<Foo> or Whatever) PromiseFoo;

   PromiseFoo bar();

...which is what I'm currently forced to do to describe APIs that throw in
certain cases and return promises when they don't throw.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Tuesday, 5 August 2014 18:25:18 UTC

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