This is a default error handler that can be used in conjunction with acl.middleware().
It is a convenience method that allows to return the proper http status code and message, instead of the default 500 error.
Basic usage:
app.get('/', acl.middleware(), function (req, res) { res.end('ok'); });
app.use(acl.middleware.errorHandler());
And a curl to this service will yield a clean http error with the correct status code and informative message:
This is a default error handler that can be used in conjunction with
acl.middleware()
. It is a convenience method that allows to return the proper http status code and message, instead of the default 500 error.Basic usage:
And a
curl
to this service will yield a clean http error with the correct status code and informative message:Also supports
html
andjson
content type: