http-error-factories

0.0.2 • Public • Published

HTTP error factories

Wraps jproulx's http-custom-errors with friendly-named factory functions. All credit there--this extension is a matter of syntactic preference only.

Install

npm install http-error-factories

Usage

Factories are defined for each error name, using the lower camelcased name of the corresponding error object. Each factory takes a single (optional) argument representing a description of the error.

var errors = require('http-error-factories');

var error = errors.internalServer('Something went horribly wrong');

error instanceof errors.HTTPError           // true
error instanceof errors.InternalServerError // true

Readme

Keywords

none

Package Sidebar

Install

npm i http-error-factories

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • rjz