sentry-javascript
sentry-javascript copied to clipboard
Track DOMException.name instead of DOMException.code
Problem Statement
DOMException.code is a deprecated feature. Reference: https://developer.mozilla.org/en-US/docs/Web/API/DOMException
The codes are also hardly practical, considering only the numeric value of them is shown in the Sentry UI:
Solution Brainstorm
DOMException.name is the current best-practice in identifying these errors, and is supported widely across browsers:
Hey @behnam-oneschema, this is something we might do for our v8 version (https://github.com/getsentry/sentry-javascript/issues/9508), adding it to our milestone!
So taking another look at this - shouldn't DOMException.name show up as the error type? Which you can search for via error.type.
Yeah, indeed it looks like DOMException.name is being indexed already as error.type. Although, It's not shown on the error details page, in contrast to DOMException.code.
@behnam-oneschema right. We are setting code as a tag on the event. This is why it shows up in that heatmap on the issues page.
Having this as a tag makes very little sense, as all the errors that are grouped together likely have the same tag value. We should some sort of context instead probably. (Side-note: having type as a tag would equally not make any sense for the same reason)
@AbhiPrasad I think the TODO for us here is to move this into a context or data field.