Skip to content

Commit

Permalink
fix(Account): call onSyncFail if onSyncStart fails
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed May 19, 2024
1 parent 1d62553 commit 6e42b0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,15 @@ export default class Account {
try {
status = await this.server.onSyncStart(needLock)
} catch (e) {
await this.server.onSyncFail()
// Resource locked
if (e.code === 37) {
Sentry.setContext('accountData', {
...this.getData(),
username: 'SENSITIVEVALUEHIDDEN',
password: 'SENSITIVEVALUVALUEHIDDEN',
passphrase: 'SENSITIVEVALUVALUEHIDDEN'
})
Sentry.captureException(e)
// We got a resource locked error
if (this.getData().lastSync < Date.now() - LOCK_TIMEOUT) {
Expand Down

0 comments on commit 6e42b0d

Please sign in to comment.