statuserror
An error with a status code.
Usage
Install:
npm i statuserror --save
Use:
var StatusError = ; // Without a message...var e = 404;// e.status == 404// e.message = "Not Found" // With a message...var e = 500 "Something has gone horribly wrong";// e.status == 500// e.message = "Something has gone horribly wrong" // With `throw`... { if !value throw 400 'Value expected'; // ...} // With Bluebird... { ; }