mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 10:33:14 +08:00
[client-sync] Improve reporting of refresh access token errors
Summary: Add better messaging and logging to the console. Depends on D4098 Test Plan: manual Reviewers: evan, khamidou, spang Reviewed By: spang Differential Revision: https://phab.nylas.com/D4099
This commit is contained in:
parent
a041b79aaa
commit
8eea5fa8ac
1 changed files with 3 additions and 2 deletions
|
@ -188,6 +188,7 @@ class SyncWorker {
|
|||
}
|
||||
return null
|
||||
} catch (err) {
|
||||
this._logger.warn(`🔃 Unable to refresh access token.`, err);
|
||||
if (err instanceof APIError) {
|
||||
const {statusCode} = err
|
||||
this._logger.error(`🔃 Unable to refresh access token. Got status code: ${statusCode}`, err);
|
||||
|
@ -208,10 +209,10 @@ class SyncWorker {
|
|||
throw new IMAPErrors.IMAPAuthenticationError(`Unable to refresh access token`);
|
||||
}
|
||||
}
|
||||
this._logger.error(`🔃 Unable to refresh access token.`, err);
|
||||
err.message = `Unknown error when refreshing access token: ${err.message}`
|
||||
const fingerprint = ["{{ default }}", "access token refresh", err.message];
|
||||
NylasEnv.reportError(err, {fingerprint: fingerprint})
|
||||
throw new Error(`Unable to refresh access token, unknown error encountered`);
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue