You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
534 B

/**
* CustomError
*
* This helper modules allows us to create different type of errors we can throw
*
* @class CustomError
* @extends {Error}
*/
class CustomError extends Error {
/**
* Creates an instance of CustomError.
* @param {*} message
* @param {string} [name='Error'] a custom name for the error object
* @memberof CustomError
*/
constructor(message, name = 'Error') {
super(message);
this.name = name;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = CustomError;