title: Node JS + Express: Error object not caught on Promise reject
body: <p>In my Express web app, I have defined a function that returns a Promise object.</p>
  
  <pre><code>login: function(un, pass) {
          result = {};
          var loginOk = new Promise(
              function (resolve, reject) {
                  if (result.hasOwnProperty('sessionToken')) {
                      var user = {username: result["username"], sessionToken: result["sessionToken"]};
                      resolve(user); // fulfilled
                  } else {
                      var reason = new Error('login failed');
                      console.log("LOGIN FAILED:" + reason.message);
                      reject(reason); // reject
                  }
  
              }
          );
          return loginOk;
  }
  </code></pre>
  
  <p>In the route that calls the login function:</p>
  
  <pre><code>router.get('/login', function(req, res, next) {
      const unm = req.query.username;
      const pwd = req.query.password;
  
      db_user.login(unm, pwd)
      .then(function(result) {
          console.log("/login:" + JSON.stringify(result));
          res.send(result);
      }).catch(function (error) {
          // Login failed
          console.log(error);  // This printed out {"Error":{}}
          console.log(error.message); // This printed out undefined. but supposed to be "login failed"!!!
          res.send(error.message);
      });
  });
  </code></pre>
  
  <p>I would like to return the error message generated from the reject callback function to the user front-end view. The problem is the error was always empty and error.message was undefined. The catch does not seem to get the error passed over from the reject.</p>