0.1.3 • Published 8 years ago

express-last-error-handler v0.1.3

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

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')
	}
})