vidit-sh / redux-sentry-middleware

Redux middleware for propagating Redux state/actions to use with new @sentry/browser and @sentry/node.
79 stars 16 forks source link

Add a callback? #20

Open delewis13 opened 4 years ago

delewis13 commented 4 years ago

Would love the ability to add a callback to execute after the error has been sent to sentry.

In my case, I have middleware = [myErrorCatchingMiddleware, Thunk, reduxSentryMiddleWare]. The function of "myErrorCatchingMiddleware" is to dispatch an update to the store to notify that an uncaught error has occurred, then re-throws the error to be caught again by reduxSentryMiddleware.

The result of this is that the last dispatched action as shown in Sentry is a result of myErrorCatchingMiddleware, as opposed to the actual action that caused the issue.

Thanks for the great module :)