title: How to get response body in axios when the status is 400?
body: <p>I'm developing an application and I want to use the status code 400 when a user sends
  invalid or incomplete data, but when axios receives a 400 status code it throws an error
  and I can't get the response from it, it just gives me a error that includes the request but not the response, how am I supposed to handle this?</p>
  <pre class="lang-js prettyprint-override"><code>const getIdTypes = () =&gt; {
    return axios_instance.get
      (idTypesUrl)
  }
  
  
  const getValidIdTypes = async () =&gt; {
    return infoActions.getIdTypes()
    .then(res =&gt; {
      if (res.status !== 200 &amp;&amp; res.status !== 201) {
        pushToFlasher(res.data)
      }
      setValidIdTypes(res.data)
    })
    .catch(err =&gt; {
      if (err.request) {
        console.log(&quot;err:&quot;, err.request)
      }
       if (err.response) {
        console.log(&quot;err:&quot;, err.response)
      }
      // pushToFlasher(err.response.data)
    })
  }
  
  
  </code></pre>