🐛Throw exception in error during exists method in storage
This commit is contained in:
@@ -125,8 +125,16 @@ export class OneOfStorageStrategy implements StorageConnectorAPI {
|
|||||||
*/
|
*/
|
||||||
exists = async (path: string, options?: ReadOptions): Promise<boolean> => {
|
exists = async (path: string, options?: ReadOptions): Promise<boolean> => {
|
||||||
for (const storage of this.storages) {
|
for (const storage of this.storages) {
|
||||||
if (await storage.exists(path, options)) {
|
try {
|
||||||
return true;
|
if (await storage.exists(path, options)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
throw new OneOfStorageReadOneFailedException(
|
||||||
|
storage.getId(),
|
||||||
|
`Reading ${path} from storage ${storage} failed.`,
|
||||||
|
e,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user