diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service.ts index 21c4653ab..3acedb02a 100644 --- a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service.ts +++ b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service.ts @@ -143,8 +143,8 @@ export class MicrosoftGetMessagesService { return response.body; } - if (!response.body) { - this.logger.error(`No body found for response`, response); + if (response.status !== 503 && response.status !== 429) { + this.logger.error(`Microsoft parseBatchResponse error`, response); } const errorParsed = response?.body?.error diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts index 37d2c3797..ac443a89f 100644 --- a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts +++ b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts @@ -40,7 +40,7 @@ export const parseMicrosoftMessagesImportError = (error: { } } - if (error.statusCode === 429) { + if (error.statusCode === 429 || error.statusCode === 503) { return new MessageImportDriverException( `Microsoft Graph API ${error.code} ${error.statusCode} error: ${error.message}`, MessageImportDriverExceptionCode.TEMPORARY_ERROR,