- 1 :
/**
- 2 :
* An error that occurs when there's an unimportant input issue
- 3 :
*/
- 4 :
class InputError extends Error {
- 5 :
/**
- 6 :
* Construct an input error
- 7 :
* @param {String} name The name of the error
- 8 :
* @param {String} message The error message
- 9 :
* @param {String|Number} code The code of error
- 10 :
*/
- 11 :
constructor (name, message, code) {
- 12 :
super(message)
- 13 :
- 14 :
/**
- 15 :
* The name of the error
- 16 :
* @type {String}
- 17 :
*/
- 18 :
this.name = name
- 19 :
- 20 :
/**
- 21 :
* The type of error
- 22 :
* @type {String}
- 23 :
*/
- 24 :
this.code = code
- 25 :
}
- 26 :
}
- 27 :
- 28 :
module.exports = InputError