dimanche 8 mars 2015

expressjs - error handling for POST requests

I am trying to register an error handling middleware in the standard way:



app.use(function(err, req, res, next){
//do something with the exception
});


It works fine for my get requests, but not for , i.e. when an error is thrown in processing of a post request, then the middleware is not invoked and the whole app crashes.


How do I register an error handler for post requests?


Aucun commentaire:

Enregistrer un commentaire