repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
122d924
)
Silence one code smell
author
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 8 Feb 2022 13:39:12 +0000
(14:39 +0100)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 8 Feb 2022 13:39:12 +0000
(14:39 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/exception/BaseError.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/exception/BaseError.ts
b/src/exception/BaseError.ts
index e1a82c001ac2718b99c12d15975278183157b223..ad78e261cfe1e0e0561cd4cf0562f7a2690f3468 100644
(file)
--- a/
src/exception/BaseError.ts
+++ b/
src/exception/BaseError.ts
@@
-3,6
+3,10
@@
export default 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.stack = (new Error()).stack);
+ Error.captureStackTrace ? (Error.captureStackTrace(this, this.constructor)) : (this.createStack());
+ }
+
+ private createStack(): void {
+ this.stack = new Error().stack;
}
}