safety-catch
Small module that makes sure your catch, caught an actual error and not a programming mistake or assertion
Last updated 3 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install safety-catch 
SYNC missed versions from official npm registry.

safety-catch

Small module that makes sure your catch, caught an actual error and not a programming mistake or assertion.

npm install safety-catch

Triggers an unhandled error in the next tick, when you pass it an SyntaxError, TypeError, AssertionError and other builtins.

Usage

const safetyCatch = require('safety-catch')

try {
  foo.bar()
} catch (err) {
  // Was this a programming mistake and should you crash your program?
  // Ask the safety catch
  safetyCatch(err)

  console.log('Actual error')
}

License

MIT

Current Tags

  • 1.0.2                                ...           latest (3 years ago)

3 Versions

  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE