express-last-error-handler
v0.1.3
Published
Error handler middleware
Downloads
4
Readme
express-last-error-handler
Install
npm i --save express-last-error-handler
Usage
import lastErrorHandler from 'express-last-error-handler'
// ...
// use after all the routes
app.use(lastErrorHandler)
Example Route
// ...
app.get((req, res) => {
if (!req.body.foo) {
// this will bubble up and return a 500 response with message
throw new Error('foo is missing')
}
})