title: catching error body using axios post
body: <p>I am sending a status code 422 from my backend code with response body which contains the description of the error. I am using axios post as below to post a request:</p>
  
  <pre><code>post: function(url, reqBody) {
      const request = axios({
          baseURL: config.apiUrl,
          url: url,
          headers: {
              'Content-Type': 'application/json',
              'Authorization': sessionStorage.getItem('token')
          },
          method: 'POST',
          data: reqBody,
          responseType: 'json'
      });
      return request
          .then((res) =&gt; {
              return res;
          })
          .catch((error) =&gt; {
              console.log(error);
              return error;
          })
  }
  </code></pre>
  
  <p>The problem is when backend is returning error code 422, the error object I am catching has no information about response body. Is there any way I can retrieve the error text?</p>