mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 10:33:14 +08:00
[iso-core] Fix imap error detection!
Summary: We were only detecting and classifying IMAP errors as retryable and non retryable in a few places, but errors thrown in any of our imap operations were not being properly passed through our `convertImapErrors` :( This was broken, oh so broken Also loosen condition to detect System Errors Test Plan: manual Reviewers: spang, mark, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D4022
This commit is contained in:
parent
feda238d9c
commit
b96300f000
2 changed files with 6 additions and 2 deletions
|
@ -346,7 +346,11 @@ class IMAPConnection extends EventEmitter {
|
|||
clearTimeout(socketTimeout)
|
||||
resolve(...args)
|
||||
}
|
||||
return callback(cbResolve, reject)
|
||||
const cbReject = (error) => {
|
||||
clearTimeout(socketTimeout)
|
||||
reject(convertImapError(error))
|
||||
}
|
||||
return callback(cbResolve, cbReject)
|
||||
})
|
||||
.finally(() => {
|
||||
if (this._imap) {
|
||||
|
|
|
@ -82,7 +82,7 @@ function convertImapError(imapError) {
|
|||
error.source = imapError.source
|
||||
return error
|
||||
}
|
||||
if (imapError.message.includes('System Error')) {
|
||||
if (/system error/i.test(imapError.message)) {
|
||||
// System Errors encountered in the wild so far have been retryable.
|
||||
error = new RetryableError(imapError)
|
||||
error.source = imapError.source
|
||||
|
|
Loading…
Reference in a new issue