-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Handle ErrorEvents in TraceKit #1162
Conversation
It doesn't cover the case where |
@michal-rumanek Woops. I misread the original comment. Fixed now. |
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.
Other than this small change, it's ready to be shipped
test/utils.test.js
Outdated
@@ -89,6 +89,7 @@ describe('utils', function() { | |||
describe('isErrorEvent', function() { | |||
it('should work as advertised', function() { | |||
assert.isFalse(isErrorEvent(new Error())); | |||
assert.isFalse(isError(new ErrorEvent(''))); |
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.
This is isError
test, not isErrorEvent
and should be moved to line ~122 w. additional supportsErrorEvent()
clause, eg. if (supportsErrorEvent()) assert.isFalse(isError(new ErrorEvent('')));
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.
Done!
@shcallaway Now the error is logged correctly in Sentry panel. Thank you :-) |
@michal-rumanek The core developers would know best, probably. But I can see multiple ways of handling to the case where
|
I think it's necessary, e.g. for the case when more than one Sentry global error handlers are installed ( |
Good catch @michal-rumanek, we indeed shouldn't modify that's passed down to other handlers. We also don't need to double check here: if (ex && utils.isErrorEvent(ex)) {
ex = ex.error;
}
if (message && utils.isErrorEvent(message)) {
message = message.message;
} and we can write it like this instead if (utils.isErrorEvent(ex)) ex = ex.error;
if (utils.isErrorEvent(message)) message = message.message; as passing |
@michal-rumanek @kamilogorek I disagree about passing the original |
@kamilogorek @michal-rumanek Can I get some feedback on this? My team can't use Sentry until we start seeing real errors instead of |
@shcallaway thanks for your patience, I was working on getsentry/sentry#6709 for last few days and had to move SDK aside for a while. Let's get it merged asap.
But what if the original developer already handled (or uses a solution that does that) case like this? We'd change expected (well, not so expected :P) behaviour. |
@shcallaway I asked other devs and we'd prefer to stick with original arguments. |
Fixed it myself, rebased and merged manually. Preserving correct author info of course :) 315dab5 Thanks for contributing! |
Released in |
You’re the best. Thanks! |
Thank you! |
Hey guys, after seeing the linked issue (#1008) I updated my raven version but I'm still receiving error reports as
And my code looks something like:
|
This PR resolves #1008 .
traceKitWindowOnError
now handles the case where theex
parameter is anErrorEvent
object.