Safari extension(Grammarly) error can not be filtered

I installed the Grammarly extension on my Safari, and every time I input something in the web page, it will reduce one error like this:

Unhandled Promise Rejection: [object Object] Grammarly.js:99565

and this error will be sent to sentry, and will not be ignored, even if I turn on the Filter out errors known to be caused by browser extensions.

How should I do for this, my SDK version is

"@nuxtjs/sentry": "^4.0.3",
"@sentry/browser": "^5.16.1",
"@sentry/integrations": "^5.16.1",

I think you are looking for this: https://docs.sentry.io/error-reporting/configuration/filtering/?platform=browsernpm

but there is no feature to identify this error in code, I can only filter it by the exception name(UnhandledRejection), and the message is empty in the event object,

@haoflynet use the beforeSend callback in sentry. It’ll give an event object as the first arg in which contains an exception like the following:

{ "values":[ { "type":"UnhandledRejection", "value":"Non-Error promise rejection captured with keys: [object has no keys]", "mechanism":{ "synthetic":true, "handled":false, "type":"onunhandledrejection" } } ] }

You can use the value as a fallback when message is empty. Using the beforeSend callback will actually help to edit the exception before sending it to sentry or exclude it out before even sending it to sentry

1 Like