X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FBaseError.ts;h=2163f6ee4d78cce456a220391f0c498783cfc34e;hb=a735b6738fbd7325c9482291e73dd018cd03be0a;hp=84421eac143b3db6440fd74cb2c8fc6ed8ec3eee;hpb=268a74bb051fcbbad532fd833f0d8fd2b33b6c64;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/BaseError.ts b/src/exception/BaseError.ts index 84421eac..2163f6ee 100644 --- a/src/exception/BaseError.ts +++ b/src/exception/BaseError.ts @@ -3,7 +3,9 @@ export class BaseError extends Error { super(message); this.name = new.target.name; Object.setPrototypeOf(this, new.target.prototype); - Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.createStack(); + typeof Error.captureStackTrace === 'function' + ? Error.captureStackTrace(this, this.constructor) + : this.createStack(); } private createStack(): void {