X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FBaseError.ts;h=4a94fc26fd24bf952331c5a7cbb52bead8fdc0e7;hb=cc04ce3549100de93505abdd6ff43fd3d968998d;hp=e1a82c001ac2718b99c12d15975278183157b223;hpb=e7accadb398c418c41571c53e2c70b1cca3e83d5;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/BaseError.ts b/src/exception/BaseError.ts index e1a82c00..4a94fc26 100644 --- a/src/exception/BaseError.ts +++ b/src/exception/BaseError.ts @@ -1,8 +1,10 @@ -export default class BaseError extends Error { - public constructor(message?: string) { - super(message); - this.name = new.target.name; - Object.setPrototypeOf(this, new.target.prototype); - Error.captureStackTrace ? (Error.captureStackTrace(this, this.constructor)) : (this.stack = (new Error()).stack); +export class BaseError extends Error { + public date: Date + + public constructor (message?: string) { + super(message) + this.name = new.target.name + this.date = new Date() + Object.setPrototypeOf(this, new.target.prototype) } }