title: exit from express middleware with specific http status
body: <p>Hopefully this is a simple one, but I have some custom middleware which I want to return a 404 or 401 etc to the user and stop the propagation of other handlers etc.</p>
  
  <p>I was expecting I could do something like:</p>
  
  <pre><code>function SomeMiddleware(req, res, next) {
     if(user.notRealOrSomething)
     { throw new HttpException(401, "Tough luck buddy"); }
  
     return next();
  }
  </code></pre>
  
  <p>However cannot find any specific info about how is best to do this.</p>