SEAPUNK / guaranteed-error

Fixes up error objects, and converts plain strings to error instances.

Repository from Github https://github.comSEAPUNK/guaranteed-errorRepository from Github https://github.comSEAPUNK/guaranteed-error

guaranteed-error

Greenkeeper badge

npm version javascript standard style travis build coveralls coverage david dependencies david dev dependencies

Fixes up error objects, and converts plain strings to error instances.

npm install guaranteed-error


try {
  doSomething()
} catch (err) {
  // err === 'something broke' (not an Error instance)
  err = guaranteedError(err)
  /* err is now an Error instance, with the following stack:
Error: something broke
    at <unknown>
  */
}

About

Fixes up error objects, and converts plain strings to error instances.


Languages

Language:JavaScript 100.0%