MusicTopus/src/libs/error.js

22 lines
473 B
JavaScript
Raw Normal View History

2022-02-15 11:03:20 +01:00
/**
* 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;