in connected account, refresh-token can fail with network error (#12815)

This PR fixes this issue from the connected account refresh token
service that is

This PR fixes error handling in `handleDriverException` by ensuring that
errors resembling `MessageImportDriverException` are correctly detected,
even if they are plain objects and not true class instances. This
prevents missed exception handling due to failed `instanceof` checks.

Was introduced by [this
PR](https://github.com/twentyhq/twenty/pull/12233) that did not know all
provider cases that can occur.

Fixes https://github.com/twentyhq/twenty/issues/12589
This commit is contained in:
Guillim
2025-06-24 13:51:03 +02:00
committed by GitHub
parent 3cee2b796f
commit 5c3550a2ee
6 changed files with 56 additions and 23 deletions
@@ -14,4 +14,5 @@ export enum MessageImportDriverExceptionCode {
UNKNOWN_NETWORK_ERROR = 'UNKNOWN_NETWORK_ERROR',
NO_NEXT_SYNC_CURSOR = 'NO_NEXT_SYNC_CURSOR',
SYNC_CURSOR_ERROR = 'SYNC_CURSOR_ERROR',
PROVIDER_NOT_SUPPORTED = 'PROVIDER_NOT_SUPPORTED',
}