Download spectrum/src/helpers/sentry-redux-middleware.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 789 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/helpers/sentry-redux-middleware.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/helpers/sentry-redux-middleware.js
-
curl -L -o sentry-redux-middleware.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/helpers/sentry-redux-middleware.js
789 Bytes
| const crashReporter = store => next => action => { | |
| // Handle THROW_ERROR actions | |
| if (action.type === 'THROW_ERROR') { | |
| console.error('Caught an exception!', action.err); | |
| if (process.env.NODE_ENV !== 'development') { | |
| window.Raven && | |
| window.Raven.captureException(action.err, { | |
| extra: { | |
| action, | |
| state: store.getState(), | |
| }, | |
| }); | |
| } | |
| } | |
| try { | |
| return next(action); | |
| } catch (err) { | |
| console.error('Caught an exception!', err); | |
| if (process.env.NODE_ENV !== 'development') { | |
| window.Raven && | |
| window.Raven.captureException(err, { | |
| extra: { | |
| action, | |
| state: store.getState(), | |
| }, | |
| }); | |
| } | |
| throw err; | |
| } | |
| }; | |
| export default crashReporter; | |