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 query runner exceptions not being handled properly #6593

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Aug 9, 2024

Context

We recently introduced a try catch in the different resolvers of the query runner to handle exceptions via workspaceQueryRunnerGraphqlApiExceptionHandler and convert them to proper errors. However this was never called as expected because query runner methods were async.
This is a regression from #6324

Before

Screenshot 2024-08-09 at 15 34 02

After

Screenshot 2024-08-09 at 15 33 46

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

The pull request addresses exception handling in various resolver factories by making resolver functions asynchronous and using try-catch blocks to ensure proper error handling.

  • /packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/create-many-resolver.factory.ts: Updated to handle exceptions with async/await and try-catch.
  • /packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/create-one-resolver.factory.ts: Made resolver function asynchronous and added try-catch for error handling.
  • /packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/delete-many-resolver.factory.ts: Ensured proper exception handling with async/await and try-catch.
  • /packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/delete-one-resolver.factory.ts: Updated to handle exceptions using async/await and try-catch.
  • /packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/find-duplicates-resolver.factory.ts: Added async/await and try-catch for proper exception handling.

9 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@thomtrp thomtrp merged commit 6792056 into main Aug 9, 2024
6 checks passed
@thomtrp thomtrp deleted the c--fix-query-runner-exceptions-not-handled-properly branch August 9, 2024 14:08
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