From 98da8062531d3baae531a51e827e4a713d089724 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 19 Sep 2026 15:16:47 +0100 Subject: [PATCH] Move errors --- frontend/sync-client/src/errors/errors.ts | 34 +++++++++++++++++++ .../file-operations/file-not-found-error.ts | 9 ----- .../src/services/authentication-error.ts | 6 ---- .../services/server-version-mismatch-error.ts | 6 ---- .../src/services/sync-reset-error.ts | 6 ---- 5 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 frontend/sync-client/src/errors/errors.ts delete mode 100644 frontend/sync-client/src/file-operations/file-not-found-error.ts delete mode 100644 frontend/sync-client/src/services/authentication-error.ts delete mode 100644 frontend/sync-client/src/services/server-version-mismatch-error.ts delete mode 100644 frontend/sync-client/src/services/sync-reset-error.ts diff --git a/frontend/sync-client/src/errors/errors.ts b/frontend/sync-client/src/errors/errors.ts new file mode 100644 index 00000000..7dc48a3a --- /dev/null +++ b/frontend/sync-client/src/errors/errors.ts @@ -0,0 +1,34 @@ +export class SyncResetError extends Error { + public constructor() { + super("SyncClient has been reset, cleaning up"); + this.name = "SyncResetError"; + } +} + +export class ServerVersionMismatchError extends Error { + public constructor(message: string) { + super(message); + this.name = "ServerVersionMismatchError"; + } +} + +export class AuthenticationError extends Error { + public constructor(message: string) { + super(message); + this.name = "AuthenticationError"; + } +} + +export class FileNotFoundError extends Error { + public constructor( + message: string, + public readonly filePath: string + ) { + super(message); + this.name = "FileNotFoundError"; + } +} + +export class PermanentSyncError extends Error { } + +export class LocalChangesDuringReconciliation extends Error { } diff --git a/frontend/sync-client/src/file-operations/file-not-found-error.ts b/frontend/sync-client/src/file-operations/file-not-found-error.ts deleted file mode 100644 index b8acd265..00000000 --- a/frontend/sync-client/src/file-operations/file-not-found-error.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class FileNotFoundError extends Error { - public constructor( - message: string, - public readonly filePath: string - ) { - super(message); - this.name = "FileNotFoundError"; - } -} diff --git a/frontend/sync-client/src/services/authentication-error.ts b/frontend/sync-client/src/services/authentication-error.ts deleted file mode 100644 index 6be4af24..00000000 --- a/frontend/sync-client/src/services/authentication-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class AuthenticationError extends Error { - public constructor(message: string) { - super(message); - this.name = "AuthenticationError"; - } -} diff --git a/frontend/sync-client/src/services/server-version-mismatch-error.ts b/frontend/sync-client/src/services/server-version-mismatch-error.ts deleted file mode 100644 index 0b9960ea..00000000 --- a/frontend/sync-client/src/services/server-version-mismatch-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class ServerVersionMismatchError extends Error { - public constructor(message: string) { - super(message); - this.name = "ServerVersionMismatchError"; - } -} diff --git a/frontend/sync-client/src/services/sync-reset-error.ts b/frontend/sync-client/src/services/sync-reset-error.ts deleted file mode 100644 index 7b74e0b9..00000000 --- a/frontend/sync-client/src/services/sync-reset-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class SyncResetError extends Error { - public constructor() { - super("SyncClient has been reset, cleaning up"); - this.name = "SyncResetError"; - } -}