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: sentry doesn't catch exceptions from flexible backend #3074

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Dec 19, 2023

As conditional schema creation is outside Nest.JS "flow" we have to manually instantiate the exception filters properly send the errors to Sentry

Fix #2916

@magrinj magrinj marked this pull request as ready for review December 19, 2023 14:42
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.

Thank you! I am not convinced by the metadata filter api usage, see comment below :)

@@ -11,6 +11,10 @@ export class GlobalExceptionFilter implements GqlExceptionFilter {
) {}

catch(exception: unknown) {
return this.catchException(exception);
Copy link
Member

Choose a reason for hiding this comment

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

+1

@@ -27,61 +20,10 @@ import { WorkspaceModule } from './workspace/workspace.module';
ConfigModule.forRoot({
isGlobal: true,
}),
GraphQLModule.forRoot<YogaDriverConfig>({
context: ({ req }) => ({ req }),
GraphQLModule.forRootAsync<YogaDriverConfig>({
Copy link
Member

Choose a reason for hiding this comment

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

Great to have extracted its own service, it was weird to have the dynamic schema at the "root" in app.module.ts

packages/twenty-server/src/graphql-config.service.ts Outdated Show resolved Hide resolved
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!

@charlesBochet charlesBochet merged commit d59a371 into main Dec 20, 2023
14 checks passed
@charlesBochet charlesBochet deleted the fix/sentry-exceptions branch December 20, 2023 11:05
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.

Error not sent to Sentry
2 participants