title: Passing object to node's Error class returns an unaccessible object
body: <p>I'm returning an <code>Error</code> object, to which I pass an object (instead of a simple message):</p>
  
  <pre><code>if (err) {
     return myCallback(new Error({
        error_code: 'sample_machine_readable_code', 
        error_message: 'There is an error in the response from the service.', 
        error: err
     }));
  }
  </code></pre>
  
  <p>And the result in the console is <code>[Error: [object Object]]</code>. I tried accessing its properties both as properties of an array and as an object, but always end up with <code>undefined</code>. <code>JSON.stringify</code>-ing it returns an empty object <code>{}</code>. By "accessing" I mean trying to log the error, f.e. with <code>console.log(err);</code> (which ends up in <code>[object Object]</code>) or <code>err.message</code> or <code>err.Error</code>, or <code>err['Error']</code>, but these were <code>undefined</code>.</p>
  
  <p>I was reading through <a href="https://nodejs.org/api/errors.html" rel="noreferrer">Node's Error class docs</a> and it seemed like it's okay to pass objects. Am I mistaken? Should I just return a simple custom-constructed object instead of a <code>new Error</code>? Like that:</p>
  
  <pre><code>if (err) {
         return myCallback({
            error_code: 'sample_machine_readable_code', 
            error_message: 'There is an error in the response from the service.', 
            error: err
         });
      }
  </code></pre>
  
  <p>Cuz I just wanted to use more of what Node offers and to stick to some widely used convention instead of going "my own way".</p>