title: Unable to access returned error response in Axios from Laravel Lumen API
body: <p>I've got a Laravel Lumen 7 RESTful API alongside a Nuxt JS front-end with Axios. My front-end makes Axios calls to the API and inside of my Lumen project I'm of course returning relevant responses and error codes. However, it appears that these responses although I can see them when I inspect the network and can see it in the preview/response tabs, I'm unable to access it from Axios in my <code>catch()</code> block...</p>
  <p>If I change it to a <code>200</code> response then I can access it from my <code>then()</code> block but this isn't ideal.</p>
  <h3>Lumen response</h3>
  <pre class="lang-php prettyprint-override"><code>return response()-&gt;json(['success' =&gt; false, 'message' =&gt; 'We\'re unable to add this domain right now, please try again shortly'], 500);
  </code></pre>
  <h3>JS Axios function</h3>
  <pre class="lang-js prettyprint-override"><code>/*
  ** Add domain
  */
  addDomain () {
  
    // add new domain
    this.$axios.post(`${process.env.API_URL}/api/domains/add`, this.domainCreation).then(res =&gt; {
      console.log(res)
    }).catch(err =&gt; {
      console.log(err) // doesn't display my Object from laravel, instead just the native error string: &quot;Error: Request failed with status code 500&quot;
    })
  
  }
  </code></pre>
  <p>Can anyone help?</p>