{"_id":"redux-catch","_rev":"14-013685c131cf449fda37eeed08ac5839","name":"redux-catch","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.0":{"name":"redux-catch","version":"1.0.0","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.com.ar/","name":"Sergio Daniel Xalambrí","email":"sergio@xalambri.com.ar"},"license":"MIT","_id":"redux-catch@1.0.0","maintainers":[{"name":"sergiodxa","email":"sergio@xalambri.com.ar"}],"homepage":"http://sergio.xalambri.com.ar/redux-catch","bugs":{"url":"https://github.com/sergiodxa/redux-catch/issues"},"dist":{"shasum":"b0e4f3121440aee2fff13cc123e47c091ec93dc0","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.0.0.tgz","integrity":"sha512-LzSxjgtQJaSoj6UOLWq5CbfxxMxwEjfmz4OygPKfLEU8hTnPbu+5/SAZ4npPvS0d7FF+9gm8jhJhTRd0OYZAWA==","signatures":[{"sig":"MEUCIF38nD06DxlaQ6LH7OmiCG8lM0H4RuvnhisV+e2/1/gOAiEA12s9dwpwG0+CnCABGmO5FmHyWMiA1e4pDEVZ/6U5yuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"build/index.js","_from":".","_shasum":"b0e4f3121440aee2fff13cc123e47c091ec93dc0","gitHead":"deb86399b567fe41fea28344dc20b226f6630a5b","scripts":{"lint":"eslint lib/index.js","test":"babel-node test/index.js | tap-spec","build":"babel lib --out-dir build","pretest":"npm run build","prebuild":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergio@xalambri.com.ar"},"repository":{"url":"git+https://github.com/sergiodxa/redux-catch.git","type":"git"},"_npmVersion":"3.8.6","description":"Error catcher middleware for Redux reducers and middlewares","_nodeVersion":"4.2.6","devDependencies":{"tape":"4.5.1","babel":"6.5.2","eslint":"2.7.0","tap-spec":"4.1.1","babel-cli":"6.7.5","babel-core":"6.7.6","babel-eslint":"6.0.2","eslint-plugin-react":"4.3.0","eslint-config-airbnb":"7.0.0","eslint-plugin-jsx-a11y":"0.6.2","babel-plugin-transform-es2015-arrow-functions":"6.5.2","babel-plugin-transform-es2015-modules-commonjs":"6.7.4"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.0.0.tgz_1460528050124_0.2610664227977395","host":"packages-12-west.internal.npmjs.com"},"directories":{}},"1.1.0":{"name":"redux-catch","version":"1.1.0","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.com.ar/","name":"Sergio Daniel Xalambrí","email":"sergio@xalambri.com.ar"},"license":"MIT","_id":"redux-catch@1.1.0","maintainers":[{"name":"sergiodxa","email":"sergio@xalambri.com.ar"}],"homepage":"http://sergio.xalambri.com.ar/redux-catch","bugs":{"url":"https://github.com/sergiodxa/redux-catch/issues"},"dist":{"shasum":"96f811dc65d083e4d028592efb02d48d9e7fca7f","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.1.0.tgz","integrity":"sha512-eKNSQ2MPOus/qyzxmY2Give21ZFdnpJ+cc+URzdQ6uEWAHv75UlMeRMI++I69qC1FJQenkOpj+1n1ZIt7q9ABA==","signatures":[{"sig":"MEYCIQDmTwWeGEY82pvLhPTKX8Z3OZmdSry326MWiHY0NHM7JAIhAKLoi5wOed7Br91QASPVd4VqvB/5msWUwpMLOBi3T/lP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"build/index.js","_from":".","_shasum":"96f811dc65d083e4d028592efb02d48d9e7fca7f","gitHead":"17eb763729127b4a6f25b8d7ac61ec9c8569f803","scripts":{"lint":"eslint lib/index.js","test":"babel-node test/index.js | tap-spec","build":"babel lib --out-dir build","pretest":"npm run build","prebuild":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergio@xalambri.com.ar"},"repository":{"url":"git+https://github.com/sergiodxa/redux-catch.git","type":"git"},"_npmVersion":"3.8.6","description":"Error catcher middleware for Redux reducers and middlewares","_nodeVersion":"4.2.6","devDependencies":{"tape":"4.5.1","babel":"6.5.2","eslint":"2.7.0","tap-spec":"4.1.1","babel-cli":"6.7.5","babel-core":"6.7.6","babel-eslint":"6.0.2","eslint-plugin-react":"4.3.0","eslint-config-airbnb":"7.0.0","eslint-plugin-jsx-a11y":"0.6.2","babel-plugin-transform-es2015-arrow-functions":"6.5.2","babel-plugin-transform-es2015-modules-commonjs":"6.7.4"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.1.0.tgz_1460531638041_0.2650452337693423","host":"packages-12-west.internal.npmjs.com"},"directories":{}},"1.1.1":{"name":"redux-catch","version":"1.1.1","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.com.ar/","name":"Sergio Daniel Xalambrí","email":"sergio@xalambri.com.ar"},"license":"MIT","_id":"redux-catch@1.1.1","maintainers":[{"name":"sergiodxa","email":"sergio@xalambri.com.ar"}],"homepage":"http://sergio.xalambri.com.ar/redux-catch","bugs":{"url":"https://github.com/sergiodxa/redux-catch/issues"},"dist":{"shasum":"c061bd4e287992fb5d698e2966a0d86c67f7c4fd","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.1.1.tgz","integrity":"sha512-PbrpPG+0YrBkLrLbvZdT8tCAASd+/Kk23iKDzI05C4ydFwQEh55wRrkl9cjxfi3cNhlCXllqvDVJtx/Oe83HLw==","signatures":[{"sig":"MEQCIDDmBJawTSfdYXpIuZQPzZQqnv6GcFXu2psBFj+x2XRlAiAudObI2IDIeI/1wxW24V4jEjWauhcf0M5ToKEpeVhteA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"build/index.js","_from":".","_shasum":"c061bd4e287992fb5d698e2966a0d86c67f7c4fd","gitHead":"1762e8aae9717c19264894816911eaf4df945f5c","scripts":{"lint":"eslint lib/index.js","test":"babel-node test/index.js | tap-spec","build":"babel lib --out-dir build","pretest":"npm run build","prebuild":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergio@xalambri.com.ar"},"repository":{"url":"git+https://github.com/sergiodxa/redux-catch.git","type":"git"},"_npmVersion":"3.8.6","description":"Error catcher middleware for Redux reducers and middlewares","_nodeVersion":"4.2.6","devDependencies":{"tape":"4.5.1","babel":"6.5.2","eslint":"2.7.0","tap-spec":"4.1.1","babel-cli":"6.7.5","babel-core":"6.7.6","babel-eslint":"6.0.2","eslint-plugin-react":"4.3.0","eslint-config-airbnb":"7.0.0","eslint-plugin-jsx-a11y":"0.6.2","babel-plugin-transform-es2015-arrow-functions":"6.5.2","babel-plugin-transform-es2015-modules-commonjs":"6.7.4"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.1.1.tgz_1461604694224_0.6085234181955457","host":"packages-16-east.internal.npmjs.com"},"directories":{}},"1.2.0":{"name":"redux-catch","version":"1.2.0","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.com.ar/","name":"Sergio Daniel Xalambrí","email":"sergio@xalambri.com.ar"},"license":"MIT","_id":"redux-catch@1.2.0","maintainers":[{"name":"leonidasesteban","email":"leonidasesteban@gmail.com"},{"name":"sergiodxa","email":"sergio@xalambri.com.ar"}],"homepage":"http://sergio.xalambri.com.ar/redux-catch","bugs":{"url":"https://github.com/sergiodxa/redux-catch/issues"},"dist":{"shasum":"a32c63a03684a465f1fbafcbd0e10ae9e8a2adcd","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.2.0.tgz","integrity":"sha512-ZSnGqh5Bx5o0DOxclL0t0SaDzkb0UzUEuLMffO7P9KEQJVk89X/hLMTz9Wuka/stg2Gz9kxjCechIv+CORaWEw==","signatures":[{"sig":"MEYCIQCQ/ZuCpTZsdyKSDFoWZUyeURcIWYx4FE4ZVMXTi75bDQIhAL+hOPZNA8Zh+ABfVOAs8226Hd1G6zlrLmGCsyEGcg7O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"a32c63a03684a465f1fbafcbd0e10ae9e8a2adcd","gitHead":"9de282f3f9a3923689a3f92e5e6606718cfaeddd","scripts":{"lint":"eslint index.js","test":"node test.js | tap-spec","pretest":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergiodxa@gmail.com"},"repository":{"url":"git+https://github.com/sergiodxa/redux-catch.git","type":"git"},"_npmVersion":"3.9.0","description":"Error catcher middleware for Redux reducers and middlewares","_nodeVersion":"4.4.4","devDependencies":{"tape":"4.5.1","eslint":"2.7.0","tap-spec":"4.1.1","eslint-plugin-react":"4.3.0","eslint-config-airbnb":"7.0.0","eslint-plugin-jsx-a11y":"0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.2.0.tgz_1470896069058_0.6239779700990766","host":"packages-16-east.internal.npmjs.com"},"directories":{}},"1.3.0":{"name":"redux-catch","version":"1.3.0","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.xyz/","name":"Sergio Daniel Xalambrí","email":"sergiodxa@gmail.com"},"license":"MIT","_id":"redux-catch@1.3.0","maintainers":[{"name":"leonidasesteban","email":"leonidasesteban@gmail.com"},{"name":"platzi","email":"y@platzi.com"},{"name":"sergiodxa","email":"sergiodxa@gmail.com"}],"homepage":"http://sergio.xalambri.xyz/redux-catch","bugs":{"url":"https://github.com/sergiodxa/redux-catch/issues"},"xo":{"space":true},"dist":{"shasum":"bab441b508fe9b3ed4b8afaaf2d03affdf374bb9","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.3.0.tgz","integrity":"sha512-j4Cte9vRHGLi6qqr/mfCpukgJfsCrGUmg0NRoqQiQqiWKZEq6imN1j0IMVcWacDidK3rsdD5MBHR16Tdb0bPoQ==","signatures":[{"sig":"MEUCIHi9O4W68+0RWZZQQS4jj1soLTwFaSCyZv+Gw3mkMV/AAiEArYcyWTk9Q88DBkEwzmCahIg5bIlDx1eXi+8n/vsn3+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"bab441b508fe9b3ed4b8afaaf2d03affdf374bb9","gitHead":"a7db7091f547ffd1e23f4d652603ae215e442c11","scripts":{"fix":"xo --fix index.js test.js","lint":"xo index.js","test":"node test.js | tap-spec","pretest":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergiodxa@gmail.com"},"repository":{"url":"git+https://github.com/sergiodxa/redux-catch.git","type":"git"},"_npmVersion":"3.10.3","description":"Error catcher middleware for Redux reducers and middlewares","_nodeVersion":"6.7.0","devDependencies":{"xo":"0.17.1","tape":"4.6.2","tap-spec":"4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.3.0.tgz_1479442733808_0.02166970632970333","host":"packages-12-west.internal.npmjs.com"},"directories":{}},"1.3.1":{"name":"redux-catch","version":"1.3.1","keywords":["redux","error","catch","middleware"],"author":{"url":"http://sergio.xalambri.xyz/","name":"Sergio Daniel Xalambrí","email":"sergiodxa@gmail.com"},"license":"MIT","_id":"redux-catch@1.3.1","maintainers":[{"name":"leonidasesteban","email":"leonidasesteban@gmail.com"},{"name":"platzi","email":"y@platzi.com"},{"name":"sergiodxa","email":"sergiodxa@gmail.com"}],"homepage":"https://github.com/PlatziDev/redux-catch","bugs":{"url":"https://github.com/PlatziDev/redux-catch/issues"},"xo":{"space":true},"dist":{"shasum":"403777632e495de38adb0953c21f44bba9d1de08","tarball":"https://registry.npmjs.org/redux-catch/-/redux-catch-1.3.1.tgz","integrity":"sha512-or6Y3viez2JaWA3lE0dx4OiMWEjIdEa73Xs0BdvUwSuV8oCOmz+iGFb4d9v2dnL5AxjaDyNJCh7arIDYDEoyxA==","signatures":[{"sig":"MEYCIQC5OFt0Aw73H4ny2T0aisYBkQy1iKb6/JBVv7CBDB0QswIhAJmG6ACtqA+R8iSKeFGnhPNRRaPJekabBzGP5gk1VjxZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"403777632e495de38adb0953c21f44bba9d1de08","gitHead":"7984f1e76434c011bd7be58a320b94cd54e7a6b4","scripts":{"fix":"xo --fix index.js test.js","lint":"xo index.js","test":"node test.js | tap-spec","pretest":"npm run lint","prepublish":"npm run test"},"_npmUser":{"name":"sergiodxa","email":"sergiodxa@gmail.com"},"repository":{"url":"git+https://github.com/PlatziDev/redux-catch.git","type":"git"},"_npmVersion":"3.10.3","description":"Error catcher middleware for Redux reducers and sync middlewares","_nodeVersion":"6.7.0","devDependencies":{"xo":"0.17.1","tape":"4.6.2","tap-spec":"4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/redux-catch-1.3.1.tgz_1481347218003_0.1749936039559543","host":"packages-12-west.internal.npmjs.com"},"directories":{}}},"time":{"created":"2016-04-13T06:14:12.594Z","modified":"2026-04-20T02:27:52.098Z","1.0.0":"2016-04-13T06:14:12.594Z","1.1.0":"2016-04-13T07:14:00.247Z","1.1.1":"2016-04-25T17:18:16.220Z","1.2.0":"2016-08-11T06:14:29.875Z","1.3.0":"2016-11-18T04:18:55.665Z","1.3.1":"2016-12-10T05:20:19.772Z"},"bugs":{"url":"https://github.com/PlatziDev/redux-catch/issues"},"author":{"url":"http://sergio.xalambri.xyz/","name":"Sergio Daniel Xalambrí","email":"sergiodxa@gmail.com"},"license":"MIT","homepage":"https://github.com/PlatziDev/redux-catch","keywords":["redux","error","catch","middleware"],"repository":{"url":"git+https://github.com/PlatziDev/redux-catch.git","type":"git"},"description":"Error catcher middleware for Redux reducers and sync middlewares","maintainers":[{"email":"hello@sergiodxa.com","name":"sergiodxa"}],"readme":"# redux-catch\nError catcher middleware for Redux reducers and sync middlewares.\n\n[![Build Status](https://travis-ci.org/PlatziDev/redux-catch.svg?branch=master)](https://travis-ci.org/PlatziDev/redux-catch)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n## API\n### Apply middleware\n```javascript\nimport { createStore, applyMiddleware } from 'redux';\n\nimport reduxCatch from 'redux-catch';\n\nimport reducer from './reducer';\n\nfunction errorHandler(error, getState, lastAction, dispatch) {\n  console.error(error);\n  console.debug('current state', getState());\n  console.debug('last action was', lastAction);\n  // optionally dispatch an action due to the error using the dispatch parameter\n}\n\nconst store = createStore(reducer, applyMiddleware(\n  reduxCatch(errorHandler)\n));\n```\n\n- `reduxCatch` receive a function to use when an error happen.\n- The error handler function could be just a `console.error` like the example above or a function to log the error in some kind of error tracking platform.\n- You should use this middleware as the first middleware in the chain, so its allowed to catch all the possible errors in the application.\n\n### Using it with [Sentry](https://www.getsentry.com/)\nTo use it with Sentry just download the Sentry script from npm:\n\n```bash\nnpm i -S raven-js raven\n```\n\n- [raven-js](https://www.npmjs.com/package/raven-js): This is the client for browser usage.\n- [raven-node](https://github.com/getsentry/raven-node): This is the client for server usage.\n\nNow load and configure your client:\n\n```javascript\nimport Raven from 'raven-js';\n\nconst sentryKey = '<key>';\n\nRaven\n  .config(`https://${sentryKey}@app.getsentry.com/<project>`)\n  .install();\n```\n\nAnd then use `Raven.captureException` as the error handler like this:\n\n```javascript\nconst store = createStore(reducer, applyMiddleware(\n  reduxCatch(error => Raven.captureException(error));\n));\n```\n\nNow `redux-catch` will start to send the errors of your reducers and middlewares to Sentry.\n\n#### Add state as extra data\nYou can also add the state data as extra data for your errors so you can know the state at the moment of the error.\n\n```javascript\nfunction errorHandler(error, getState, action) {\n  Raven.context({\n    state: getState(),\n    action,\n  });\n  Raven.captureException(error);\n}\n```\n","readmeFilename":"README.md","users":{"sergiodxa":true,"rahulraghavankklm":true}}