X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FBaseError.ts;h=4a94fc26fd24bf952331c5a7cbb52bead8fdc0e7;hb=4c6f35659fb67d395adc035ef80c566eb6eef79e;hp=ad78e261cfe1e0e0561cd4cf0562f7a2690f3468;hpb=35efcc3a2921eebb5bcb1c00b95f656e1b777058;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/BaseError.ts b/src/exception/BaseError.ts index ad78e261..4a94fc26 100644 --- a/src/exception/BaseError.ts +++ b/src/exception/BaseError.ts @@ -1,12 +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.createStack()); - } +export class BaseError extends Error { + public date: Date - private createStack(): void { - this.stack = new Error().stack; + public constructor (message?: string) { + super(message) + this.name = new.target.name + this.date = new Date() + Object.setPrototypeOf(this, new.target.prototype) } }