thing-assert
v1.1.0
Published
Thing model assert
Downloads
9
Maintainers
Readme
thing-assert
Description
Nodejs's assert error has no status code. Through thing-assert you can define your own error status and capture from the thrown out error object.
Install
$ npm i thing-assert
Usage
const thingAssert = require('thing-assert')
try {
thingAssert(false, 'error message', 400)
} catch (error) {
console.log(error.status) // output 400
}
Questions & Suggestions
Please open an issue here.