Skip to content
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

Fix exception handler capturing graphql errors #5714

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Jun 3, 2024

Our exception handler has to filter out some errors/exceptions so they are not caught by the ExceptionHandlerDriver (Logged or Sentry for example). This is done for Http errors in the range of 4xx and also makes sure they are converted back to Graphql validation errors.
However, graphql validation errors that are already managed by Yoga (with Schema validation) should also be filtered out, this PR should fix that behaviour

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

  • Added check to filter out GraphQL errors in shouldFilterException
  • Ensured GraphQL errors are not captured by the exception handler service
  • Consistent handling with HTTP exceptions (status < 500)
  • Prevents unnecessary logging of expected GraphQL errors

@Weiko Weiko merged commit e2dc660 into main Jun 3, 2024
6 checks passed
@Weiko Weiko deleted the c--fix-exception-handler-capturing-gql-errors branch June 3, 2024 12:36
piyushyadav1617 pushed a commit to piyushyadav1617/twenty that referenced this pull request Jun 3, 2024
Our exception handler has to filter out some errors/exceptions so they
are not caught by the ExceptionHandlerDriver (Logged or Sentry for
example). This is done for Http errors in the range of 4xx and also
makes sure they are converted back to Graphql validation errors.
However, graphql validation errors that are already managed by Yoga
(with Schema validation) should also be filtered out, this PR should fix
that behaviour
arnavsaxena17 pushed a commit to arnavsaxena17/twenty that referenced this pull request Oct 6, 2024
Our exception handler has to filter out some errors/exceptions so they
are not caught by the ExceptionHandlerDriver (Logged or Sentry for
example). This is done for Http errors in the range of 4xx and also
makes sure they are converted back to Graphql validation errors.
However, graphql validation errors that are already managed by Yoga
(with Schema validation) should also be filtered out, this PR should fix
that behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants