A way of explicitly reporting exceptions

Kevin Reid kpreid at google.com
Mon Jun 23 13:17:19 PDT 2014


On Mon, Jun 23, 2014 at 12:44 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 6/23/14, 3:35 PM, Kevin Reid wrote:
>
>> Yes, but setTimeout may be less prompt than you want depending on the
>> application
>>
>
> Note that at least in some browsers window.onerror is called off an event
> loop task anyway.


Clarification: I meant how promptly the listener is invoked (independent of
the error case).


>  This has a nifty advantage in debuggability: you can declare that a
>> debugger's "stop on uncaught exception" should stop on such errors
>> _before the stack is unwound_.
>>
>
> Note that such a facility would still fail in cases when a catch examines
> and then rethrows an exception,


Yes, it would stop at the rethrow rather than the original throw. Doing
more than that is hard.


> and in fact allows observably detecting whether an exception is caught and
> rethrown or just not caught.


I did not intend it to do so. Could you explain?

(You can notice rethrows and things by inspecting the stack trace, but I
assume that's not what you meant.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140623/c4b10bba/attachment.html>


More information about the es-discuss mailing list