-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use original Error object for uncaught errors when provided #2403
Conversation
@freshp86 this helps with stack traces in Chrome's WebUI tests |
@mgiuffrida going to try to release v3.0.0 tonight, so you might want to wait until that happens before retrying. |
Uses the existing error instead of creating a new stack trace from the current context.
@boneskull thanks, that was silly of me. From the actual |
@@ -51,8 +51,11 @@ process.removeListener = function(e, fn){ | |||
|
|||
process.on = function(e, fn){ | |||
if ('uncaughtException' == e) { | |||
global.onerror = function(err, url, line){ | |||
fn(new Error(err + ' (' + url + ':' + line + ')')); | |||
global.onerror = function(err, url, line, col, errObj){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should col
be leveraged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't currently, and it normally isn't in JS, right?
Closing for inactivity; please reopen if continuing. Thanks! |
Include stack trace of async errors by not throwing away the Error passed by global.onerror.
Fixes #958, the same issue referenced at #815 (comment).