X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FBaseError.ts;h=4a94fc26fd24bf952331c5a7cbb52bead8fdc0e7;hb=d9c13bcac891b8686dbba36ae5c10f87948e3614;hp=6b9ea70fd914de381f4bf90a82abd9778dc8c9fd;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/BaseError.ts b/src/exception/BaseError.ts index 6b9ea70f..4a94fc26 100644 --- a/src/exception/BaseError.ts +++ b/src/exception/BaseError.ts @@ -1,14 +1,10 @@ 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) - typeof Error.captureStackTrace === 'function' - ? Error.captureStackTrace(this, this.constructor) - : this.createStack() - } - - private createStack (): void { - this.stack = new Error().stack } }