23 lines
502 B
JavaScript
23 lines
502 B
JavaScript
/**
|
|
* Classe permettant la gestion des erreurs personilisées
|
|
*/
|
|
class ErrorEvent extends Error {
|
|
/**
|
|
* @param {Number} errorCode
|
|
* @param {String} title
|
|
* @param {Mixed} ...params
|
|
*/
|
|
constructor(errorCode, title, ...params) {
|
|
super(...params);
|
|
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, ErrorEvent);
|
|
}
|
|
|
|
this.errorCode = parseInt(errorCode, 10);
|
|
this.title = title;
|
|
this.date = new Date();
|
|
}
|
|
}
|
|
|
|
export default ErrorEvent;
|