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