@ahmadnassri/error
v2.0.4
Published
Extendable Error Class for use with Node >= 4.x
Downloads
405
Readme
Extendable Error
Extendable Error Class for use with Node.js
Install
npm install @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
}
}
Author: Ahmad Nassri • Twitter: @AhmadNassri