Created by: philjackson
A couple of patches (one updating the README) which allow a user to handle middleware errors in much the same way they might in express. For example, within the middleware calling:
next(new Error("I'm a gonner"));
Now emits middlewareError
and can be handled later like this:
server.proxy.on('middlewareError', function (err, res, req) {
// handle the error here and call res.end()
});
This change is backwardly compatible and the old behaviour persists if nothing heard the middlewareError
event.