err-http
v1.2.2
Published
Error constructors for common http error types
Downloads
661
Maintainers
Readme
err-http
Error constructors for common HTTP error types.
npm install err-http
Usage:
var app = express();
var BadRequestError = require('err-http/badrequest');
var CustomError = require('err-http')('TeapotError', 'I am a teapot', 418);
app.get('/test', function (req, res, next) {
next(new BadRequestError('Invalid!'));
});