title: Express js - Error handling in middleware
body: <p>I have a route </p>
  
  <pre><code> app.get("/some/url/", function(req, res){ res.sendStatus(404) })
  </code></pre>
  
  <p>I am trying to handle or catch this 404 in express error handling middleware and it is not working</p>
  
  <pre><code> app.use(function(err, req, res, next){do something here})
  </code></pre>
  
  <p>Any help how do i capture the error thrown by route in the middleware.</p>