throwy
0.1.0 • Public • Published throwy
Helper for throwing informative errors in Node.js and the browser
Install
npm install throwy
Usage
var throwy = require('throwy')
try {
throwy({
msg: 'Could not connect to db',
connString: 'postgresql://postgres:admin@localhost:5432/master'
})
} catch (ex){
ex.toString()
ex.message
}
You can configure throwy
to call a function for you whenever a throwy error is thrown
throwy.configure({
onError: function(err, details){
console.log('Cause :' + details.cause)
}
})
throwy({
msg: 'failure',
cause: 'server is shut down'
})
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.1.0
0
Version History
- VersionDownloads (Last 7 Days)
- 0.1.0
0
Package Sidebar
Install
Weekly Downloads