1.1.1 • Published 9 years ago

http-status-error v1.1.1

Weekly downloads
37
License
MIT
Repository
github
Last release
9 years ago

http-status-error Build Status

Create errors using an HTTP status

Install

$ npm install --save http-status-error

Usage

var httpStatusError = require('http-status-error')

httpStatusError(200)
//=> null

httpStatusError(404)
//=> err.message => "Not Found (404)"
//=> err.statusCode => 404

API

httpStatusError(code) -> null / error

input

Required
Type: number

An HTTP status code.

License

MIT © Ben Drucker