Skip to content

Fix capture exception for metadata and core #3335

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

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Jan 9, 2024

Context

Exceptions were not captured and sent to Sentry for Core and Metadata schema. However it was working for our conditionalSchema which was manually calling our globalExceptionHandler util.

Implementation && Fix

  • I removed the GlobalExceptionFilter since it was not used here (GraphqlModule was internally catching and converting exceptions GqlError)
  • Separated exceptions handlers and conversion to GqlError in separate functions, created a handleExceptionAndConvertToGraphQLError.
  • Added a handleExceptionAndConvertToGraphQLError that does both to match with previous implementation.
  • Using maskError from yogaDriver config allows us to intercept those convertedGraphqlErrors and convert them back to exceptions with originalError attribute so we can then call our handleExceptionAndConvertToGraphQLError method and capture them with sentry

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

LGTM! I've left a comment, we might want to re-add it later

@@ -30,12 +26,5 @@ import { WorkspaceModule } from './workspace/workspace.module';
CoreModule,
WorkspaceModule,
],
providers: [
Copy link
Member

Choose a reason for hiding this comment

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

we might have to re-add this for commands, jobs and rest controllers?

@charlesBochet charlesBochet merged commit 6c00aa9 into main Jan 9, 2024
@charlesBochet charlesBochet deleted the c--fix-capture-exception-for-metadata-and-core branch January 9, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants