captbaritone / raven-for-redux

A Raven middleware for Redux
295 stars 25 forks source link

Overwriting of `extra` when capturing an exception #58

Closed zeorin closed 6 years ago

zeorin commented 6 years ago

I've implemented this library in my Redux middleware and it's generally working quite well.

However, I've also set up some React Error Boundaries that report to my Sentry.io instance, as per https://blog.sentry.io/2017/09/28/react-16-error-boundaries.

When I manually trigger Raven.captureException in my Error Boundary component as per the blog post, an exception is logged on Sentry, but without the componentStack part being in the extra part of the data that is being sent to Sentry. The state is there as expected.

If I inspect the network request that's being made to Sentry, it's the same. The state is there, but the property that was added to extra in the captureException call has been discarded.

zeorin commented 6 years ago

Additionally, if the above is fixed, it'd be awesome if one could still overwrite the state that is automatically added by manually specified state in extra. This is useful when e.g. a promise throws an error after some time and we'd like to send a report with the state at the time the promise was created rather than the state at the time that it threw an error.

captbaritone commented 6 years ago

Would something like this work? https://github.com/captbaritone/raven-for-redux/pull/59

zeorin commented 6 years ago

That looks great! Thank you!

captbaritone commented 6 years ago

Published in 1.3.0