@ianwremmel/http-server-exceptions

1.0.1 • Public • Published

@ianwremmel/http-server-exceptions

license standard-readme compliant

Greenkeeper badge dependencies Status devDependencies Status semantic-release

CircleCI Coverage Status

Server-side exceptions and express middleware

Install

npm install @ianwremmel/http-server-exceptions

Usage

Setup the Middleware

const middleware = require('@ianwremmel/http-server-exceptions');
app.use(middleware());

Throw an Error

const {BadGateway} = require('@ianwremmel/http-server-exceptions');
app.use(`/always-fails`, (req, res, next) => {
  next(new BadGatway('remote server could not be reached', req));
});

Maintainers

Ian Remmel

Contribute

See CONTRIBUTE

License

© MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @ianwremmel/http-server-exceptions

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ianwremmel