`ignoreErrors` and `beforeSend` options both cannot stop report error
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/angular”: “^6.2.3”,
- “@sentry/integrations”: “^6.2.3”,
- “@sentry/cli”: “^1.63.1”,
Version:
0.0.0
Description
My sentry received a lot of meaningless events:
TypeError undefined is not an object (evaluating 'window.__pad.performLoop')
I want to stop this kind of events go into my sentry through ignoreErrors
option:
Sentry.init({
ignoreErrors: [
/window.__pad.performLoop/i
],
})
but this ignoreErrors
not working at all. So I have tried to use beforeSend
option to achieve this:
const ignoreErrors = [
'window.__pad.performLoop'
];
beforeSend(event) {
if (event && event.message && ignoreErrors.find(item => event.message.includes(item))) {
return null;
}
return event;
}
Again, beforeSend
option also not working, and my sentry still receive a lot of this events.
Here is my event json file.(I change it to txt format since github cannot upload json) event.txt
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (8 by maintainers)
Top Results From Across the Web
Error when returning null in beforeSend · Issue #3047 - GitHub
I tested returning null from both beforeSend callback and an event process, both dropped the event correctly and no issue similar to the...
Read more >Filtering for React | Sentry Documentation
Filtering Error Events. Configure your SDK to filter error events by using the beforeSend callback method and configuring, enabling, or disabling integrations.
Read more >React / Sentry for Error Reporting - How to not send errors ...
The easiest way I could get it working was to set the beforeSend method in Sentry.init to return null if the location is...
Read more >@iobroker/js-controller-common-db | Yarn - Package Manager
The Library contains the common utils of ioBroker which use the DB directly and thus cannot be required by the DB itself (cirular...
Read more >Customizing error reports - JavaScript - Bugsnag docs
If you want to halt the error notification completely, call report.ignore() or return false from beforeSend . You can set a beforeSend callback...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kamilogorek You were right about caching. Those errors have no release numbers because we had a regression that the release value wasn’t being passed. The new code has the release number and nothing for that release value is coming through. I decided to keep with using the
Error Message
filter inSettings
. It’s a bit obfuscated since it’s not in the code but we don’t have to depend on the script. Thank you so much!!@kamilogorek Thanks for your effort. After seeing your test, I begin to think if it is my mistake that make this unexplainable result. So can i close this issue since my problem has been solved, and as for
ignoreErrors
, I cannot investigate anymore. If I haveignoreErrors
problems in future, and will open a new issue.