title: NodeJS bug with promise.catch and console.log?
body: <p>When running the following code, I get different results depending on if I have <code>console.log("fnError: ", fnError)</code> commented out or not.  This seems very off to me.</p>
  
  <p><strong>How in the world is a call to <code>console.log</code> affecting my promises?</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>function run() {
      var fn = function(){
          throw new Error("incorrect message");
      };
  
      // returns a promise that should fail with
      // an error object whose .message is "correct message"
      var promisifiedFn = function(){
          return Promise.resolve()
              .then(fn)
              .catch((fnError) =&gt; {
                  // commenting this out fixes things! //
                  console.log("fnError: ", fnError);
                  ///////////////////////////////////////
  
                  fnError.message = "correct message";
                  throw fnError;
              })
      }
  
      promisifiedFn().catch((e) =&gt; {
          console.log("caught error.message:", e.message);
          console.log("caught error:", e);
      });
  }
  run();
  </code></pre>
  
  <p>The above produces:</p>
  
  <pre><code>// fnError:  Error: incorrect message
  //     at fn (/Users/sam/dev/ethereum/pennyeth/js/temp.js:18:9)
  //     at &lt;anonymous&gt;
  //     at process._tickCallback (internal/process/next_tick.js:169:7)
  //     ...
  // caught error.message: correct message
  // caught error: Error: incorrect message
  //     at fn (/Users/sam/dev/ethereum/pennyeth/js/temp.js:18:9)
  //     at &lt;anonymous&gt;
  //     at process._tickCallback (internal/process/next_tick.js:169:7)
  //     ...
  </code></pre>
  
  <p>Notice "incorrect message" being logged.  And if you comment out <code>console.log("fnError: ", fnError)</code> you get this:</p>
  
  <pre><code>// caught error.message: correct message
  // caught error: Error: correct message
  //     at fn (/Users/sam/dev/ethereum/pennyeth/js/temp.js:18:9)
  //     at &lt;anonymous&gt;
  //     at process._tickCallback (internal/process/next_tick.js:169:7)
  //     ....
  </code></pre>
  
  <p>Running node 8.0.0</p>