title: React Axios Handle 401
body: <p>how to handle 401 Unauthorized status code with Axios Interceptor. This snippet print error in console but I still get RED error code in console, how to remove it?</p>
  <pre><code>axios.interceptors.response.use(
   response =&gt; {
     console.log(&quot;Axios Response: &quot;, response);
     return response;
  },
  error =&gt; {
   if (error.response.status === 401) {
    console.log(&quot;RESPONSE 401&quot;);
    return Promise.reject(error.response);
  }
  console.log(&quot;Axios Response Error: &quot;, error.response);
  return Promise.reject(error);
  </code></pre>
  <p>}
  );</p>
  <p><a href="https://i.stack.imgur.com/a7YAz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a7YAz.png" alt="enter image description here" /></a></p>