Skip to content

Commit 18277ed

Browse files
committed
add code as tag
1 parent 75d3225 commit 18277ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/browser/src/eventbuilder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function eventFromUnknownInput(
7878
}
7979
if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {
8080
// If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
81-
// then we just extract the name and message, as they don't provide anything else
81+
// then we just extract the name, code, and message, as they don't provide anything else
8282
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
8383
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
8484
const domException = exception as DOMException;
@@ -87,6 +87,8 @@ export function eventFromUnknownInput(
8787

8888
event = eventFromString(message, syntheticException, options);
8989
addExceptionTypeValue(event, message);
90+
event.tags = domException.code ? { ...event.tags, 'DOMException.code': String(domException.code) } : event.tags;
91+
9092
return event;
9193
}
9294
if (isError(exception as Error)) {

0 commit comments

Comments
 (0)