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 base graphql error message #6457

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Fix base graphql error message #6457

merged 1 commit into from
Jul 30, 2024

Conversation

thomtrp
Copy link
Contributor

@thomtrp thomtrp commented Jul 30, 2024

Display error message instead of name

Capture d’écran 2024-07-30 à 15 51 07

@charlesBochet
Copy link
Member

LGTM!

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 update improves error reporting by displaying the actual error message instead of the error name in GraphQL responses.

  • Modified packages/twenty-server/src/engine/core-modules/graphql/utils/generate-graphql-error-from-error.util.ts to use error.message for BaseGraphQLError.
  • Ensures more informative error messages for debugging.
  • Maintains conditional inclusion of stack trace and error message in development mode to avoid exposing sensitive information in production.

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

@@ -5,7 +5,7 @@ import {

export const generateGraphQLErrorFromError = (error: Error) => {
const graphqlError = new BaseGraphQLError(
error.name,
error.message,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Ensure error messages do not expose sensitive information in production.

@charlesBochet charlesBochet merged commit 68e3730 into main Jul 30, 2024
5 of 6 checks passed
@charlesBochet charlesBochet deleted the tt-fix-error-message branch July 30, 2024 13:56
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