Bug 104408
Summary: | Add exception object and stack trace to window.onerror | ||
---|---|---|---|
Product: | WebKit | Reporter: | Chris Cinelli <chris.cinelli> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Enhancement | CC: | ap, aroben, doochik, oliver |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Chris Cinelli
Something on the the line of what is discussed here: http://lists.w3.org/Archives/Public/public-whatwg-archive/2012May/thread.html#msg124
The reason is that as an organization I want to be able to catch errors in the code that we produce and being able to fix it.
I can (in most of the cases) sends an ajax request to the server to record what went wrong for further analysis.
I have been trying to use this: https://github.com/eriwen/javascript-stacktrace but it does not work because the onerror function does not have the context of the error.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Oliver Hunt
The spec explicitly states that onerror gives you the error string, url, and line number. We can't arbitrarily extends a spec as we see fit.
Any way, the onerror api is already providing the most information that can be safely exposed -- the error object or stack trace can both be used to expose information in violation of the cross origin policy. We recognize the difficulty this presents, but the reality is that we cannot specify behaviour that has fundamental security problems. Your best bet is to use the debugger as it can do anything it wants (as it is obviously necessary to consider it trusted)
Adam Roben (:aroben)
The spec actually says that the original error object should be made available: http://html5.org/r/8086
This bug seems to be a dupe of bug 55092. I'm thinking about starting to work on fixing it. Oliver, if you still have concerns can you explain them in bug 55092?
*** This bug has been marked as a duplicate of bug 55092 ***