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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26517

--- Comment #26 from Tab Atkins Jr. <jackalmage@gmail.com> ---
(In reply to Olli Pettay from comment #25)
> (In reply to Jonas Sicking from comment #22)
> > I don't know of any APIs which have synchronous side-effects and which also
> > return a promise. So you can't rely on anything having successfully happened
> > on the line after the .foo() call anyway.
>
> Just passing wrong types of params to foo. It is not really a side-effect,
> but a basic type validation (or whatever term the spec uses).
> And I'm not interested in the success case, I'm interested in the case when
> an error has occurred. That information should be given to the caller asap.

Some "basic validations" can be performed synchronously, others can only be
done async.  Having to split error-handling logic between sync and async isn't
great, as it produces the two-locations annoyance that has already been brought
up as an author complaint, and is often quite arbitrary.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 7 October 2014 18:10:24 UTC