Improve reporting of chrome extension errors (and possibly others)?
See original GitHub issue- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
5.10.2, but nothing has changed as of 5.11.0
Description
In certain circumstances, Chrome throws an Extension context invalidated
error. Though it’s an actual Error
object, including a stacktrace, it wraps that Error
object in a CustomEvent
with the following structure:
{
currentTarget: <object>,
detail:
{
promise: <object>,
reason: <the Error object including stacktrace>
},
isTrusted: <boolean>,
target: <object>,
type: unhandledrejection
}
As a result, when it comes through to Sentry, it gets lumped with all other CustomEvent
events, under the heading Non-Error promise rejection captured with keys: currentTarget, detail, isTrusted, target
. Though the original error and its stacktrace are visible in the Additional Data
section of the event details page, the fact that it lives there means it’s not subject to the normal grouping/filtering/etc mechanisms.
In this particular example, that of the Extension context invalidated
error, it’s likely that this would always be considered noise, as, unless you are the extension developer themselves, you probably don’t care that your end user happens to be running some third-party extension which has had a problem. In that case, even with the nested structure, these errors can be filtered out using the code mentioned here.
However, it’s an open question whether other, potentially-useful errors also come wrapped up this way, and if this is a common enough occurrence that it’s worthwhile to have the SDK unwrap them automatically, so that they can be treated as full, first-class errors. (In the meantime, code to do this unwrapping manually in beforeSend
is attached in a comment below.) Such unwrapping would also allow systems like the server-side “Filter out errors known to be caused by browser extensions” filter to act on this particular error.*
Alternatively (or in addition), we could teach the SDK to always ignore this particular error.
* Note that in order for the server-side filter to catch this error, the Extension context invalidated
message would have to be added to the list of known extension errors, but that’s easy enough to do.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top GitHub Comments
I have a few thousand of these events users in the past few days. I have “Filter out errors known to be caused by browser extensions” turned on. In the last 5 months its been 133k events from only 44 users.
@kamilogorek I have “Filter out errors known to be caused by browser extensions” already turned on and still exhausted my quota.