Skip to content

Commit

Permalink
🐛Throw exception in error during exists method in storage
Browse files Browse the repository at this point in the history
  • Loading branch information
shepilov committed Dec 12, 2024
1 parent c20a97e commit 93750c5
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,16 @@ export class OneOfStorageStrategy implements StorageConnectorAPI {
*/
exists = async (path: string, options?: ReadOptions): Promise<boolean> => {
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;
Expand Down

0 comments on commit 93750c5

Please sign in to comment.