title: Re-throwing exception in NodeJS and not losing stack trace
body: <p>How can I rethrow an error or exception in nodejs/javascript and include a custom message.</p>
  
  <p>I have the following code</p>
  
  <pre><code>var json = JSON.parse(result);
  </code></pre>
  
  <p>and I wanted to include the <code>result</code> content in the exception message should any parsing error occurs. Something like this.</p>
  
  <pre><code>1.  try {
  2.    var json = JSON.parse(result);
  3.    expect(json.messages.length).to.be(1);
  4.  } catch(ex) {
  5.    throw new Error(ex.message + ". " + "JSON response: " + result);
  6.  }
  </code></pre>
  
  <p>The problem here is that I lose my stack trace.</p>
  
  <p>Is there a way to do it similar to <code>java</code>?</p>
  
  <pre><code>throw new Error("JSON response: " + result, ex);
  </code></pre>