title: Proper way to handle errors in redux using redux-promise
body: <p>I'm trying "redux-promise".
  When there's no error in the flow, my code works properly. But, let's say that the API is down or I have a typo in the URL. In those cases, I expect to handle the error in the proper way. </p>
  
  <p>This is the <code>API</code>: <a href="https://jsonplaceholder.typicode.com/users" rel="nofollow noreferrer">https://jsonplaceholder.typicode.com/users</a>
  (in the snippet I'm adding random text at the end to produce the 404)</p>
  
  <p><strong>Action creator</strong></p>
  
  <pre><code>export async function fetchUsers() {
  
    const request = await axios
      .get('https://jsonplaceholder.typicode.com/userssdfdsfdsf')
      .catch(error =&gt; console.log('ERROR', error))
  
    return {
      type: FETCHING_USERS,
      payload: request
    };
  }
  </code></pre>
  
  <p><strong>Reducer</strong></p>
  
  <pre><code>export default (state = [], action) =&gt; {
    switch (action.type) {
      case FETCHING_USERS:
        return [...state, ...action.payload.data]
  
      default:
        return state
    }
  }
  </code></pre>
  
  <p>I can see the error logged in the console</p>
  
  <pre><code>ERROR Error: Request failed with status code 404
  </code></pre>
  
  <p>But, once the action is dispatched its payload is <code>undefined</code></p>
  
  <p><code>action {type: "FETCHING_USERS", payload: undefined}</code></p>
  
  <p>I don't know where is the best place to handle this: action creator, reducer, etc. I shouldn't check if payload is something in the reducer and, if not, return state or do nothing. I want to understand which would be the best approach to handle this.</p>