W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] Structured clone for an Error object

From: Drew Wilson <atwilson@google.com>
Date: Fri, 26 Feb 2010 10:44:17 -0800
Message-ID: <f965ae411002261044h43a7c428q5fc5c22cc3ba76ce@mail.gmail.com>
BTW, the spec says that unhandled exceptions are either propagated to the
parent Worker object (in the case of dedicated workers) or reported to the
user via the console (for shared workers).

So I'm not certain why passing Error objects via postMessage() would be
necessary for a spec-compliant UA (note that some UAs have bugs in their
implementation such that not all exceptions in Workers are logged to the
console, but that shouldn't motivate a change in the spec).

-atw

On Thu, Feb 25, 2010 at 8:21 PM, ATSUSHI TAKAYAMA <
taka.atsushi at googlemail.com> wrote:

> Hi,
>
> Right now, in the spec "2.7.5 Safe passing of structured data", it says
>
> If input is another native object type (e.g. Error)
> Return the null value.
>
> but if we want to debug workers, it's more convenient to be able to
> pass the error directly rather than
>
> postMessage({name: err.name, message: err.message})
>
> which loses all information like line number, etc. or we will just
> start cloning every property of the Error (stack, lineNumber,
> stacktrace, etc depending on the browser).
>
> I think that's an unnecessary chore for all developers. We should just
> be able to postMessage an error.
>
> (of course, the best solution would be to be able to console.debug
> from a worker thread, but it's not a standard way yet)
>
> A. TAKAYAMA
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100226/255addfd/attachment.htm>
Received on Friday, 26 February 2010 10:44:17 UTC

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