Package Exports
- err-object
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (err-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
err-object
Custom error object.
Tired writing code like this:
const error = new SomeError('message')
error.code = 'SOME_ERROR'There are tremendous modules about custom errors in the NPM, but NONE of those could be usable.
Install
$ npm install err-objectUsage
import err from 'err-object'
const message = 'message'
err(message)
// Error
// - message
err({
message,
name: 'ImplementError',
code: 'ERR_IMPL'
})
// Error
// - message
// - name: 'ImplementError'
// - code: 'ERR_IMPL'
err(message, TypeError)
// TypeError
// - messageLicense
MIT