mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 19:43:04 +08:00
Report errors earlier
This commit is contained in:
parent
5e0bcc5eff
commit
dffb87bd4a
1 changed files with 6 additions and 4 deletions
|
@ -202,10 +202,6 @@ class SyncWorker {
|
||||||
|
|
||||||
onSyncError(error) {
|
onSyncError(error) {
|
||||||
this.closeConnection()
|
this.closeConnection()
|
||||||
// Continue to retry if it was a network error
|
|
||||||
if (error instanceof Errors.RetryableError) {
|
|
||||||
return Promise.resolve()
|
|
||||||
}
|
|
||||||
|
|
||||||
this._logger.error(error, `SyncWorker: Error while syncing account`)
|
this._logger.error(error, `SyncWorker: Error while syncing account`)
|
||||||
global.Metrics.reportMetric({
|
global.Metrics.reportMetric({
|
||||||
|
@ -213,6 +209,12 @@ class SyncWorker {
|
||||||
value: 1,
|
value: 1,
|
||||||
type: global.Metrics.Counter,
|
type: global.Metrics.Counter,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Continue to retry if it was a network error
|
||||||
|
if (error instanceof Errors.RetryableError) {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
|
||||||
this._account.syncError = jsonError(error)
|
this._account.syncError = jsonError(error)
|
||||||
return this._account.save()
|
return this._account.save()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue