Skip to content

Commit 425ed47

Browse files
committed
Don't special case DOMExceptions that are also Errors
1 parent cc47929 commit 425ed47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/browser/src/eventbuilder.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
isError,
88
isErrorEvent,
99
isEvent,
10+
isInstanceOf,
1011
isPlainObject,
1112
SyncPromise,
1213
} from '@sentry/utils';
@@ -73,7 +74,10 @@ export function eventFromUnknownInput(
7374
event = eventFromStacktrace(computeStackTrace(exception as Error));
7475
return event;
7576
}
76-
if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {
77+
if (
78+
isDOMError(exception as DOMError) ||
79+
(isDOMException(exception as DOMException) && !isInstanceOf(exception, Error))
80+
) {
7781
// If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
7882
// then we just extract the name, code, and message, as they don't provide anything else
7983
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError

0 commit comments

Comments
 (0)