err-http

1.2.2 • Public • Published

NPM Version NPM Downloads License

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

Package Sidebar

Install

npm i err-http

Weekly Downloads

160

Version

1.2.2

License

MIT

Last publish

Collaborators

  • aantthony