Skip to content

bendrucker/http-status-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Create errors using an HTTP status

Resources

License

Stars

Watchers

Forks

Packages

No packages published