Error catcher middleware for Redux that intercepts errors thrown in reducers and synchronous middlewares. Version 1.3.1 is the latest stable release, with infrequent updates. It allows you to provide a custom error handler function that receives the error, current state via getState, the last dispatched action, and a dispatch function. Unlike Redux's built-in error handling, redux-catch supports logging, reporting to services like Sentry, and optionally dispatching actions on errors. It should be placed as the first middleware in the chain. Comes as ES module (no Babel build, uses arrow functions).
npm install redux-catchVerified import paths — ran on the pinned version, not inferred.
Creates a Redux store with the redux-catch middleware to catch errors from reducers and sync middlewares, logging them and optionally dispatching actions.
Use a different error handling pattern for async middleware (e.g., wrap your async thunks in try-catch).
Ensure reduxCatch is the first argument to applyMiddleware, or positioned before other middleware.
Use function(error, getState, lastAction, dispatch) { ... } for v1.3.0+.Ensure your build system supports ES6 features; redux-catch uses arrow functions. Add babel-polyfill if needed for older environments.
No dependency data recorded yet.