From 93750c5afc6912a1e53f6c9910f07459d4580780 Mon Sep 17 00:00:00 2001 From: Anton SHEPILOV Date: Thu, 12 Dec 2024 20:47:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BThrow=20exception=20in=20error=20du?= =?UTF-8?q?ring=20exists=20method=20in=20storage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/storage/oneof-storage-strategy.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tdrive/backend/node/src/core/platform/services/storage/oneof-storage-strategy.ts b/tdrive/backend/node/src/core/platform/services/storage/oneof-storage-strategy.ts index b71c7026..5d0a8569 100644 --- a/tdrive/backend/node/src/core/platform/services/storage/oneof-storage-strategy.ts +++ b/tdrive/backend/node/src/core/platform/services/storage/oneof-storage-strategy.ts @@ -125,8 +125,16 @@ export class OneOfStorageStrategy implements StorageConnectorAPI { */ exists = async (path: string, options?: ReadOptions): Promise => { for (const storage of this.storages) { - if (await storage.exists(path, options)) { - return true; + try { + if (await storage.exists(path, options)) { + return true; + } + } catch (e) { + throw new OneOfStorageReadOneFailedException( + storage.getId(), + `Reading ${path} from storage ${storage} failed.`, + e, + ); } } return false;