0.0.2 • Published 10 years ago

http-error-factories v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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
0.0.2

10 years ago

0.0.1

10 years ago