Skip to content

adding new error codes to the temporary catch #12366

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

guillim
Copy link
Contributor

@guillim guillim commented May 28, 2025

For microsoft, examples of errors from the logs:

Screenshot 2025-05-28 at 18 02 48

Fixes #12252

@guillim guillim self-assigned this May 28, 2025
Copy link
Contributor

github-actions bot commented May 28, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:49238

This environment will automatically shut down when the PR is closed or after 5 hours.

@guillim guillim marked this pull request as ready for review May 28, 2025 16:34
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

Enhanced error handling for Gmail and Microsoft messaging services by adding explicit handling of server-side error status codes (503, 502, 504, 509) as temporary errors.

  • Added dedicated case for 503 status code in /packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/utils/parse-gmail-messages-import-error.util.ts
  • Expanded Microsoft error handling in /packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts to include 503 and 509 status codes
  • Added handling for 'Authentication backend unavailable' errors with formatted messages for Gmail services
  • Implemented consistent TEMPORARY_ERROR classification for server-side issues across both Gmail and Microsoft implementations

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

if (errors?.[0]?.message.includes(`Authentication backend unavailable`)) {
return new MessageImportDriverException(
`${code} - ${reason} - ${message}`,
MessageImportDriverExceptionCode.TEMPORARY_ERROR,
Copy link
Collaborator

Choose a reason for hiding this comment

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

as it will introduced to the team soon, error codes are now also used as a grouping criteria for CustomEceptions on sentry when present.
Here MessageImportDriverExceptionCode.TEMPORARY_ERROR is used multiple times for what seems to be different different errors. Maybe here it could be UNAVAILABLE_AUTH_ERROR for instance

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.

Unknown: Request failed with status code 503
2 participants