mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 10:33:14 +08:00
[*] Catch more invalid login errors when sending
Summary: See title Test Plan: manual Reviewers: evan, halla, spang Reviewed By: halla, spang Differential Revision: https://phab.nylas.com/D3994
This commit is contained in:
parent
3a33b0ad64
commit
1722e8bb39
1 changed files with 3 additions and 3 deletions
|
@ -48,12 +48,12 @@ class SendmailClient {
|
|||
|
||||
// TODO: figure out how to parse different errors, like in cloud-core
|
||||
// https://github.com/nylas/cloud-core/blob/production/sync-engine/inbox/sendmail/smtp/postel.py#L354
|
||||
if (error.message.startsWith("Invalid login: 535-5.7.8 Username and Password not accepted.")) {
|
||||
throw new APIError('Sending failed - Invalid login', 401, {originalError: error})
|
||||
if (/invalid login/i.test(error.message)) {
|
||||
throw new APIError(`Sending failed - Invalid login`, 401, {originalError: error})
|
||||
}
|
||||
|
||||
if (error.message.includes("getaddrinfo ENOTFOUND")) {
|
||||
throw new APIError('Sending failed - Network Error', 401, {originalError: error})
|
||||
throw new APIError(`Sending failed - Network Error`, 401, {originalError: error})
|
||||
}
|
||||
|
||||
if (error.message.includes("connect ETIMEDOUT")) {
|
||||
|
|
Loading…
Reference in a new issue