W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] Proposal: Add window.getLastError (or modify invocation arguments of window.onerror)

From: James Greene <james.m.greene@gmail.com>
Date: Fri, 12 Jul 2013 14:14:15 -0500
Message-ID: <CALrbKZgMzOYs6222t3y8OQ323zc4V4RMex4Cv-P+_AuDgupXsw@mail.gmail.com>
To: Elliott Sprehn <esprehn@chromium.org>
Cc: Oliver Hunt <oliver@apple.com>, whatwg@lists.whatwg.org, Nathan Broadbent <nathan.f77@gmail.com>, Garrett Smith <dhtmlkitchen@gmail.com>, Simon Pieters <simonp@opera.com>
I'd love that! Perhaps similar to what Node.js did with their
`uncaughtException`
event <http://nodejs.org/api/process.html#process_event_uncaughtexception>?

Sincerely,
    James Greene



On Fri, Jul 12, 2013 at 1:40 PM, Elliott Sprehn <esprehn@chromium.org>wrote:

> Can we just add a new event that takes an event object instead of a huge
> list of arguments? :)
>
>
> On Fri, Jul 12, 2013 at 11:30 AM, James Greene <james.m.greene@gmail.com>wrote:
>
>> I'd rather get an Error-like duck-typed object with this shell info for
>> cross-domain requests than to not get a real Error object when the
>> unhandled error *is* from the same origin.
>>
>> Adding the trace as another new argument to `window.onerror` is certainly
>> an option but the parameter list is getting long and I suspect that Error
>> prototypes may still gain additional properties in the future.  Continuing
>> down this path of adding more parameters rather than just passing an Error
>> instance or Error-like object (or providing a separate supplemental method
>> like `window.getLastError()` seems like one of those decisions that might
>> results in infinite sadness in the future.
>>
>> Sincerely,
>>     James Greene
>>
>>
>>
>> On Mon, Mar 11, 2013 at 5:50 AM, Simon Pieters <simonp@opera.com> wrote:
>>
>>> On Tue, 05 Feb 2013 08:20:27 +0100, Elliott Sprehn <esprehn@chromium.org>
>>> wrote:
>>>
>>>  On Mon, Feb 4, 2013 at 5:44 PM, Oliver Hunt <oliver@apple.com> wrote:
>>>>
>>>>  ...
>>>>> That's tricky - what is your "stack trace"?  You can very easily end up
>>>>> leaking private information across frames.
>>>>>
>>>>>
>>>>>  window.onerror is triggered across non-same origin frames?
>>>>
>>>
>>> Yes, but always with these arguments:
>>>
>>> "Script error.", "", 0, 0
>>>
>>> --
>>> Simon Pieters
>>> Opera Software
>>>
>>
>>
>
Received on Friday, 12 July 2013 19:15:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC