mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 10:38:11 +08:00
[local-sync] Make invalid imap box errors retryable
Summary: If we attempt to operate on a box that is no longer open, we should make the error retryable so that we re-open the correct box and continue syncing instead of showing the scary red box to users Addresses T7680 Test Plan: manual Reviewers: evan, spang, halla, mark Reviewed By: halla, mark Subscribers: mark Differential Revision: https://phab.nylas.com/D3792
This commit is contained in:
parent
1d96c3f4da
commit
ded002924a
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
const _ = require('underscore');
|
||||
|
||||
const {
|
||||
RetryableError,
|
||||
IMAPConnectionNotReadyError,
|
||||
} = require('./imap-errors');
|
||||
|
||||
|
@ -23,7 +24,7 @@ class IMAPBox {
|
|||
const openBox = obj._conn.getOpenBoxName()
|
||||
if (myBox !== openBox) {
|
||||
return () => {
|
||||
throw new Error(`IMAPBox::${prop} - Mailbox is no longer selected on the IMAPConnection (${myBox} != ${openBox}).`);
|
||||
throw new RetryableError(`IMAPBox::${prop} - Mailbox is no longer selected on the IMAPConnection (${myBox} != ${openBox}).`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue