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