title: Sentry: How to configure Sentry in Redux to report errors based if an Action to Api call is failed?
body: <p>I am using sentry to report the unhandled exceptions in my react app which are caught by componentDidCatch method.I want to handle sentry to report the errors caused while calling an Api, In my application all the API calls are done through redux.If the API call to certain end point is failed and if and only if the error returns a status code of 500 (or) 403 (or) 402.Please help me in configuring the sentry to report errors occured when api call is failed in redux store.</p>
  
  <pre><code>  import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
    import { reducer as permissions } from 'react-redux-permissions';
    import thunk from 'redux-thunk';
    import apiMiddleware from './middleware';
    import worksection from '../modules/worksection/redux';
    import advertisements from '../modules/adevertisemnts/redux';
    import tasksLists from '../modules/taskLists/redux';
    import general from '../general_redux';
    import profile from '../components/topbar/profile/redux';
  
  
     const crashReport = store =&gt; next =&gt; action =&gt; {
       try {
         return next(action); // dispatch
       } catch (err) {
          console.error('Caught an exception!', err);
          throw err; // re-throw error
        }
       }
  
     const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
     const store = createStore(
       combineReducers({
         general,
         worksection,
         permissions,
         advertisements,
         profile,
        }),
        composeEnhancers(applyMiddleware(apiMiddleware),
          applyMiddleware(crashReport),applyMiddleware(thunk))
         );
  
         export default store;
  </code></pre>