Gmail temporary error (#12058)

# Handling Google error

This bug is hard to reproduce so the resolution is based only on the
Sentry logs. There is not definite error code
for this error message. in the documentation.
https://developers.google.com/workspace/gmail/api/guides

This is why i added more 5xx code types in order to be sure we catch
this. In order to refine this later, i added the error code to the
message.

Fixes https://github.com/twentyhq/twenty/issues/12025
This commit is contained in:
Guillim
2025-05-15 16:12:10 +02:00
committed by GitHub
parent f782f4dcd8
commit c95c4383b4

View File

@ -75,12 +75,22 @@ export const parseGmailMessagesImportError = (
);
case 500:
case 502:
case 503:
case 504:
if (reason === 'backendError') {
return new MessageImportDriverException(
message,
MessageImportDriverExceptionCode.TEMPORARY_ERROR,
);
}
if (errors?.[0]?.message.includes(`Authentication backend unavailable`)) {
return new MessageImportDriverException(
`${code} - ${reason} - ${message}`,
MessageImportDriverExceptionCode.TEMPORARY_ERROR,
);
}
break;
default: