W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] Error propagation in child workers

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 24 Dec 2008 13:25:33 +0100
Message-ID: <63df84f0812240425s46befad6k67991f1a10c4fc45@mail.gmail.com>
On Wed, Dec 24, 2008 at 12:51 AM, Ian Hickson <ian at hixie.ch> wrote:
> On Tue, 23 Dec 2008, Jonas Sicking wrote:
>> >
>> > I ended up using a combination of both the event mechanism and the old
>> > Window.onerror mechanism. The spec now says to fire onerror in the
>> > worker global scope, using the old mechanism, and if that doesn't
>> > handle the error then a series of events going up the chain to the
>> > browsing context is fired until one is canceled.
>> What is the advantage of this? Seems like this is just re-inventing
>> try-catch. (yes, the same question can be posed for window.onerror, but
>> at least there there are legacy reasons).
> Having the error be first reported outside of the context that created the
> error seems really weird. window.onerror is a very widely used feature, I
> don't see why it wouldn't be equally widely used in workers.

If window.onerror really is popular despite the fact that try/catch
now exists (it didn't when window.onerror was originally created) then
I'm fine either way.

/ Jonas
Received on Wednesday, 24 December 2008 04:25:33 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:08 UTC