From 51baa4d8e0a432c5850a66ded3c2732f123a5661 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 22 Nov 2025 20:19:13 +0000 Subject: [PATCH] Have the same error message for file not found --- .../sync-client/src/file-operations/file-not-found-error.ts | 5 ++++- .../src/file-operations/safe-filesystem-operations.ts | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 index 63af7dab..8725e81e 100644 --- a/frontend/sync-client/src/file-operations/file-not-found-error.ts +++ b/frontend/sync-client/src/file-operations/file-not-found-error.ts @@ -1,5 +1,8 @@ export class FileNotFoundError extends Error { - public constructor(message: string) { + public constructor( + message: string, + public readonly filePath: string + ) { super(message); this.name = "FileNotFoundError"; } diff --git a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts index 10d8bae6..30d47f77 100644 --- a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts +++ b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts @@ -117,7 +117,8 @@ export class SafeFileSystemOperations implements FileSystemOperations { ): Promise { if (!(await this.fs.exists(path))) { throw new FileNotFoundError( - `File '${path}' not found before trying to ${operationName}` + `File not found before trying to ${operationName}`, + path ); } @@ -131,7 +132,8 @@ export class SafeFileSystemOperations implements FileSystemOperations { throw error; } else { throw new FileNotFoundError( - `File '${path}' not found when trying to ${operationName}` + `File not found when trying to ${operationName}`, + path ); } }