title: How to read out error message detail in javascript
body: <p>I have a try/catch block and i am trying to print out the error message detail, which i get from backend</p>
  
  <p>So, I get the response like this: </p>
  
  <p><strong>Response payload</strong></p>
  
  <pre><code>{
    "errors": [
      {
        "id": "b01cf93d-8f62-4fc9-b7e7-1d912d5aa657",
        "title": "Runtime Error",
        "detail": "Name already exists",
        "status": "500"
      }
    ]
  }
  </code></pre>
  
  <p>Bit if I am trying something like this: </p>
  
  <pre><code>   myMethod().then((res) =&gt; {
       ...   
      }).catch((e) =&gt; {
        console.log("here is error", e)
      });
  </code></pre>
  
  <p>it gives me invalid object error and doesn't show the message. I also tried <code>JSON.stringify()</code> and access it like <code>e.errors[0].detail</code> but it didn't help.</p>
  
  <p>How could I print the <strong>detail</strong> out? </p>