repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perf: lookup connector status once at OCPP responses handling
[e-mobility-charging-stations-simulator.git]
/
src
/
exception
/
BaseError.ts
diff --git
a/src/exception/BaseError.ts
b/src/exception/BaseError.ts
index e1a82c001ac2718b99c12d15975278183157b223..84421eac143b3db6440fd74cb2c8fc6ed8ec3eee 100644
(file)
--- a/
src/exception/BaseError.ts
+++ b/
src/exception/BaseError.ts
@@
-1,8
+1,12
@@
-export
default
class BaseError extends Error {
+export class BaseError extends Error {
public constructor(message?: string) {
super(message);
this.name = new.target.name;
Object.setPrototypeOf(this, new.target.prototype);
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);
+ Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.createStack();
+ }
+
+ private createStack(): void {
+ this.stack = new Error().stack;
}
}
}
}