Skip to content

Commit ef465c9

Browse files
committed
remove redundant Error casts
1 parent 52dafca commit ef465c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/browser/src/eventbuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ export function eventFromUnknownInput(
228228

229229
return event;
230230
}
231-
if (isError(exception as Error)) {
231+
if (isError(exception)) {
232232
// we have a real Error object, do nothing
233-
return eventFromError(exception as Error);
233+
return eventFromError(exception);
234234
}
235235
if (isPlainObject(exception) || isEvent(exception)) {
236236
// If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize

packages/integrations/src/extraerrordata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class ExtraErrorData implements Integration {
105105
continue;
106106
}
107107
const value = error[key];
108-
extraErrorInfo[key] = isError(value) ? (value as Error).toString() : value;
108+
extraErrorInfo[key] = isError(value) ? value.toString() : value;
109109
}
110110

111111
// Check if someone attached `toJSON` method to grab even more properties (eg. axios is doing that)
@@ -114,7 +114,7 @@ export class ExtraErrorData implements Integration {
114114

115115
for (const key of Object.keys(serializedError)) {
116116
const value = serializedError[key];
117-
extraErrorInfo[key] = isError(value) ? (value as Error).toString() : value;
117+
extraErrorInfo[key] = isError(value) ? value.toString() : value;
118118
}
119119
}
120120

0 commit comments

Comments
 (0)