-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry filter #318
Sentry filter #318
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/index.tsx
Outdated
const error = hint.originalException; | ||
|
||
const ignoreErrors = [ | ||
/GraphQL/i, // filter out graphql errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it also filter out real exceptions if they contain the GraphQL string?
This question doesn't block merge, but will need to be addressed in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe there will be any honestly. We can if this will be a problem have a unique prepended string like [Playground:GraphQL] if needed.
src/index.tsx
Outdated
// filter out blacklisted errors | ||
if (error && error.message) { | ||
for (const filter of ignoreErrors) { | ||
if (error.message.match(filter)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the matching logic is required. If you define ignoreErrors outside of the function as an initialization param it will automatically match and filter out the strings from the error messages: https://docs.sentry.io/clients/javascript/config/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've seen that not sure why I added as a function. Maybe I was thinking we will need more than regex. Will change to that.
This PR implements Sentry error filtering as described on official docs. It currently blacklist two types of errros:
GraphQL
errors andNetwork
errors which were mostly spam since they were not really related to the client issues.For contributor use:
Files changed
in the Github PR explorer