-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rethrow logic adds an extra stacktrace line which causes culprit to be set to raven.js #300
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
Comments
I assume #200 would solve this as well, right? Since we'd just shift everything down the stack. |
In most cases, it would. I am experimenting with using Sentry in an environment where all scripts get minified and bundled together, so I don't think there is any way to guess whether something is inside raven.js just from the stack trace (although that might depend on the browser, e.g. Chrome's stack trace API seems to provide direct access to the function objects in the stack so it could easily identify a custom function). I guess the solution to that could be source maps and overriding the culprit on the server side. |
* Remove exception rethrowing from TraceKit.report. Raven would catch them again so it is pointless, and it can pollute the stack trace (since TraceKit doesn't extract information from it immediately, only after the rethrow has happened, adding another call to the top of the stack). * Update jsdoc TraceKit.repoer to make clear that additional arguments are passed to the handlers. * Remove the try-catch in Raven.captureException that was made unnecessary by the change. Fixes getsentry#300.
This should be irrelevant now as well. |
Steps to reproduce:
Expected result: culprit is the function which throws the error
Actual result: culprit is raven.js
Raw stack trace looks like this:
Sentry report is at http://sentry-beta.wmflabs.org/jserrors/jserrors/group/14/
What seems to happen is that the wrapper rethrows the exception (this is line 195 of
wrapped()
inRaven.wrap()
), that causes an extra line to be added to the stacktrace, and that line gets identified as the culprit.This seems to be the combination of two bugs:
The text was updated successfully, but these errors were encountered: