mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 18:44:01 +08:00
[cloud-api] Improve auth error logging
This commit is contained in:
parent
7c99e9c55f
commit
05fd276ec7
1 changed files with 3 additions and 1 deletions
|
@ -140,13 +140,15 @@ module.exports = {
|
|||
return reply(JSON.stringify(response));
|
||||
})
|
||||
.catch((err) => {
|
||||
request.logger.error(err)
|
||||
if (err instanceof IMAPErrors.IMAPAuthenticationError) {
|
||||
global.Logger.error({err}, 'Encountered authentication error while attempting to authenticate')
|
||||
return reply({message: USER_ERRORS.IMAP_AUTH, type: "api_error"}).code(401);
|
||||
}
|
||||
if (err instanceof IMAPErrors.RetryableError) {
|
||||
global.Logger.error({err}, 'Encountered retryable error while attempting to authenticate')
|
||||
return reply({message: USER_ERRORS.IMAP_RETRY, type: "api_error"}).code(408);
|
||||
}
|
||||
global.Logger.error({err}, 'Encountered unknown error while attempting to authenticate')
|
||||
return reply({message: USER_ERRORS.AUTH_500, type: "api_error"}).code(500);
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue