guaranteed-error
v1.0.0
Published
Fixes up error objects, and converts plain strings to error instances.
Downloads
34
Readme
guaranteed-error
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>
*/
}