Skip to content

rlidwka/error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

error

NPM Version NPM Downloads Node.js Version Build Status Coverage Status

A simple subclass of Error that allows to set http status using chaining api.

Installation

$ npm install error

API

var Error = require('error')

var err = new Error('message').http(404)
console.log(err.status)
// 404

throw new Error('message').http(404)
// Error 404: message
//    at new Error (/tmp/error.js:7:16)
//    at Error (/tmp/error.js:5:40)
//    at Object.<anonymous> (/tmp/index.js:6:7)
//    at Module._compile (module.js:456:26)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published