-
-
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
Callback to set options depending on captured exception #972
Conversation
|
||
assert.isTrue(Raven._handleStackInfo.calledWith( | ||
// sinon sandbox does not exposes match property before sinon 2.0 | ||
sinon.match.any, |
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.
Could be replaced by this.sinon.match.any
if Sinon is updated to >= 2.0
(support added in sinonjs/sinon#1076)
Would it be good enough if dataCallback (or similar) just passed along the error object, and you were able to then augment the Sentry payload from there? |
2 things I can think of that we should consider this against:
|
I want the error object in a callback per Slack convo. It's non trivial to do today, but it's the right solution. |
I totally see your point in not having too many callbacks. Having access to the error object in |
Actually I'm wondering if it would not make more sense to introduce the same behavior as in |
Any update on what we could do on this one? :) |
@benvinegar @dcramer was there a consensus whether we should expose error object itself in |
@kamilogorek IMO we should if we can. It makes it possible to do a lot more behavior by inspecting the object that you otherwise can't reasonable do. |
We absolutely should, the only reason I waffled on this was that the |
Effectively duplicate of #980 |
When throwing an error, it sometimes make sense to add some extra data directly to the
Error
object like so:Right now, if we want this extra sent alongside the error, we need to override
Raven.captureException
like so:With this PR, it allows us to replace this overriding with a simple config: