@mhio/exception
v0.2.1
Published
Extend Errors into Exceptions
Downloads
3
Readme
Exception - @mhio/exception
ES2015+ Exception class extending Error
Install
yarn add @mhio/exception
npm install @mhio/exception
Usage
import { Exception } from '@mhio/exception'
class MyException extends Exception {
constructor( message, options = {} ){
super(message, options)
this.myprop = options.myprop
}
}
throw new MyException('Normal error message', { simple: 'Set a simple message', label: 'UI Label', myprop: 13 })
Links
- Github - mhio/node-exception
- npm - @mhio/exception