diff --git a/server/src/services/library.service.ts b/server/src/services/library.service.ts index 9af646e25b..5c33dd8979 100644 --- a/server/src/services/library.service.ts +++ b/server/src/services/library.service.ts @@ -394,7 +394,16 @@ export class LibraryService extends BaseService { private async processEntity(filePath: string, ownerId: string, libraryId: string) { const assetPath = path.normalize(filePath); - const stat = await this.storageRepository.stat(assetPath); + + let stat: Stats; + try { + stat = await this.storageRepository.stat(assetPath); + } catch (error: any) { + if (error.code === 'ENOENT') { + this.logger.error(`File not found during import: ${assetPath} (original path: ${filePath})`); + } + throw error; + } return { ownerId,