README
Extendable Error
Extendable Error Class for use with
Node >= 4.x
Install
npm install --production --save @ahmadnassri/error
Usage
const ExtendableError = require('@ahmadnassri/error')
class MyError extends ExtendableError {
// constructor is optionaly useful for adding custom arguments, or methods:
constructor (code, message, extra) {
super(message)
this.code = code
this.extra = extra
}
getCode () {
return this.code
}
}
License: ISC • Copyright: ahmadnassri.com • Github: @ahmadnassri • Twitter: @ahmadnassri