title: Express Passport (node.js) error handling
body: <p>I've looked at how error handling should work in node via <a href="https://stackoverflow.com/questions/7151487/error-handling-principles-for-nodejs-express-apps">this question <em>Error handling principles for Node.js + Express.js applications?</em></a>, but I'm not sure what passport's doing when it fails authentication. I have the following LocalStrategy:</p>
  <pre><code>passport.use(new LocalStrategy({ usernameField: 'email', passwordField: 'password' },
    function(email, password, next) {
   
      User.find({email: UemOrUnm}, function(err, user){
        if (err) { console.log('Error &gt; some err'); return next(err); }
        if (!user) { console.log('Error &gt; no user'); return next('Incorrect login or password'); } 
  
        if (password != user.password) {
          return next(Incorrect login or password);
        }
        return next(null, user);
      });
    }
  ));
  </code></pre>
  <p>After I see 'Error &gt; some err' console printout, nothing else happens. I would think it should continue on the the next path with an error parameter, but it doesn't seem to do that. What's going on?</p>