title: Printing an error object in javascript
body: <p>When throwing an Error object in my promise chain, i attach a "details" property to it so that the handler can know what to do with it in the eventual catch block.</p>
  
  <p>If logging is enabled, what i do in part of the chain is log the error and then rethrow it like so :</p>
  
  <pre><code>.somePartOfThePromiseChain
  .catch(err =&gt; {
              console.log("ERROR");
              console.log(err.details);
              debugger;
              throw err;
            });
  </code></pre>
  
  <p>This works fine however, if i wanted to print the entire Error i dont get an object as expected but something that looks different like so :</p>
  
  <pre><code>Error: My error description here
      at API.js:105
      at &lt;anonymous&gt;
  </code></pre>
  
  <p>while i was expecting a collapsable object format as per usual in Chrome dev tools. </p>
  
  <p>Im not sure why this happens as i essentially just want to print the Error object and view its members when debugging. This has nothing to do with me rethrowing the error as you can imagine.</p>
  
  <p>Thanks a bunch.</p>