Skip to content

Commit

Permalink
fix: Throw CancelledSyncError not InterruptedSyncError
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Jul 25, 2024
1 parent 6092472 commit e45479b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/lib/adapters/GoogleDrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Credentials from '../../../google-api.credentials.json'
import {
AuthenticationError,
DecryptionError, FileUnreadableError,
GoogleDriveAuthenticationError, HttpError, InterruptedSyncError, MissingPermissionsError,
GoogleDriveAuthenticationError, HttpError, CancelledSyncError, MissingPermissionsError,
NetworkError,
OAuthTokenError, ResourceLockedError
} from '../../errors/Error'
Expand Down Expand Up @@ -188,7 +188,7 @@ export default class GoogleDriveAdapter extends CachingAdapter {
timeout(ms) {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms)
this.cancelCallback = () => reject(new InterruptedSyncError())
this.cancelCallback = () => reject(new CancelledSyncError())
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/adapters/NextcloudBookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import Ordering from '../interfaces/Ordering'
import {
AuthenticationError, CreateBookmarkError,
HttpError, InterruptedSyncError,
HttpError, CancelledSyncError,
MissingPermissionsError,
NetworkError,
ParseResponseError,
Expand Down Expand Up @@ -832,7 +832,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
})
} catch (e) {
if (timedOut) throw e
if (this.canceled) throw new InterruptedSyncError()
if (this.canceled) throw new CancelledSyncError()
console.log(e)
throw new NetworkError()
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/adapters/WebDav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Crypto from '../Crypto'
import {
AuthenticationError,
DecryptionError, FileUnreadableError,
HttpError, InterruptedSyncError,
HttpError, CancelledSyncError,
LockFileError, MissingPermissionsError,
NetworkError, RedirectError, ResourceLockedError,
SlashError
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class WebDavAdapter extends CachingAdapter {
timeout(ms) {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms)
this.cancelCallback = () => reject(new InterruptedSyncError())
this.cancelCallback = () => reject(new CancelledSyncError())
})
}

Expand Down Expand Up @@ -369,7 +369,7 @@ export default class WebDavAdapter extends CachingAdapter {
} catch (e) {
Logger.log('Error Caught')
Logger.log(e)
if (this.abortSignal.aborted) throw new InterruptedSyncError()
if (this.abortSignal.aborted) throw new CancelledSyncError()
throw new NetworkError()
}
if (res.status === 0 && !this.server.allowRedirects) {
Expand Down Expand Up @@ -438,7 +438,7 @@ export default class WebDavAdapter extends CachingAdapter {
} catch (e) {
Logger.log('Error Caught')
Logger.log(e)
if (this.abortSignal.aborted) throw new InterruptedSyncError()
if (this.abortSignal.aborted) throw new CancelledSyncError()
throw new NetworkError()
}
if (res.status === 0 && !this.server.allowRedirects) {
Expand Down

0 comments on commit e45479b

Please sign in to comment.