-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: use correct fileurl in ignore/whitelisturl calls for captureMessage redirects #1304
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
// if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call | ||
// to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd | ||
// initialCall => captureException(string) => captureMessage(string) | ||
if (initialCall && initialCall.func === 'Raven.captureException') { |
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.
I'm not sure if we shouldn't use /captureException$/
here or not, as someone may use a different object's name when not using our singleton. But it sounds like a very odd edge-case.
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.
meh, i think this is good unless some minification or babel transform on class or function names could break this string equality
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.
nice find! 😂 and reasonable fix.
i'm concerned that people are occasionally confused by the behavior of raven from the console (mostly that foo.doesn'tExist() doesn't hit sentry) but that's a problem for another day.
// if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call | ||
// to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd | ||
// initialCall => captureException(string) => captureMessage(string) | ||
if (initialCall && initialCall.func === 'Raven.captureException') { |
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.
meh, i think this is good unless some minification or babel transform on class or function names could break this string equality
Yeah, I myself had no clue that errors triggered in console are not caught by |
Ref: #1298 (comment)