mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 10:33:14 +08:00
[iso-core] Fix imap error detection/coercion (again)
Summary: If for whatever reason we passed an error with a `source` property we weren't accounting for in `convertIMAPError`, we would return an `undefined` error. Bad! Instead, just return the original error Test Plan: manual Reviewers: spang, halla, evan, mark Reviewed By: evan, mark Differential Revision: https://phab.nylas.com/D4037
This commit is contained in:
parent
e6b35497b8
commit
93836f7973
1 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ class IMAPCertificateError extends NylasError { }
|
|||
*
|
||||
*/
|
||||
function convertImapError(imapError) {
|
||||
let error;
|
||||
let error = imapError;
|
||||
|
||||
if (imapError.message.toLowerCase().includes('try again')) {
|
||||
error = new RetryableError(imapError)
|
||||
|
@ -115,7 +115,7 @@ function convertImapError(imapError) {
|
|||
case "timeout-auth":
|
||||
error = new IMAPAuthenticationTimeoutError(imapError); break;
|
||||
default:
|
||||
return error
|
||||
break;
|
||||
}
|
||||
error.source = imapError.source
|
||||
return error
|
||||
|
|
Loading…
Reference in a new issue