Skip to content

Commit 6b044f8

Browse files
sonicoder86ngabor84
andcommitted
fix(typescript): dont require error as input
EME-5173 Co-authored-by: Gabor Nemeth <gabor.nemeth@emarsys.com>
1 parent f387b2a commit 6b044f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/logger/logger.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ export class Logger {
113113
this._log(severity, action, Object.assign(this._getErrorDetails(error), data));
114114
}
115115

116-
fromError(action: string, error: Error, data: unknown = {}) {
117-
this.customError('error', action, error, data);
116+
fromError(action: string, error: unknown, data: unknown = {}) {
117+
this.customError('error', action, error as Error, data);
118118
}
119119

120-
warnFromError(action: string, error: Error, data: unknown = {}) {
121-
this.customError('warn', action, error, data);
120+
warnFromError(action: string, error: unknown, data: unknown = {}) {
121+
this.customError('warn', action, error as Error, data);
122122
}
123123

124124
timer() {

src/timer/timer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ export class Timer {
5151
);
5252
}
5353

54-
fromError(action: string, error: Error, data: unknown = {}) {
54+
fromError(action: string, error: unknown, data: unknown = {}) {
5555
this._logger.fromError(
5656
action,
5757
error,
5858
Object.assign({ duration: this._duration() }, data)
5959
);
6060
}
6161

62-
warnFromError(action: string, error: Error, data: unknown = {}) {
62+
warnFromError(action: string, error: unknown, data: unknown = {}) {
6363
this._logger.warnFromError(
6464
action,
6565
error,

0 commit comments

Comments
 (0)