mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-23 22:12:24 +03:00
Handle Network errors in messaging sync
This commit is contained in:
parent
e4a4499b79
commit
01c0378b7a
@ -18,7 +18,7 @@ type SyncStep =
|
||||
| 'messages-import';
|
||||
|
||||
export type GmailError = {
|
||||
code: number;
|
||||
code: number | string;
|
||||
reason: string;
|
||||
};
|
||||
|
||||
@ -94,7 +94,21 @@ export class MessagingErrorHandlingService {
|
||||
workspaceId,
|
||||
);
|
||||
break;
|
||||
case 'ECONNRESET':
|
||||
case 'ENOTFOUND':
|
||||
case 'ECONNABORTED':
|
||||
case 'ETIMEDOUT':
|
||||
case 'ERR_NETWORK':
|
||||
// We are currently mixing up Gmail Error code (HTTP status) and axios error code (ECONNRESET)
|
||||
|
||||
// In case of a network error, we should retry the request
|
||||
await this.handleRateLimitExceeded(
|
||||
error,
|
||||
syncStep,
|
||||
messageChannel,
|
||||
workspaceId,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
await this.messagingChannelSyncStatusService.markAsFailedUnknownAndFlushMessagesToImport(
|
||||
messageChannel.id,
|
||||
|
Loading…
Reference in New Issue
Block a user