throw error from downloadFile util
This commit is contained in:
parent
ba78b74e70
commit
0be74faecd
|
@ -514,12 +514,16 @@ function PhotoViewer(props: Iprops) {
|
|||
const downloadFileHelper = async (file) => {
|
||||
if (file && props.enableDownload) {
|
||||
appContext.startLoading();
|
||||
await downloadFile(
|
||||
file,
|
||||
publicCollectionGalleryContext.accessedThroughSharedURL,
|
||||
publicCollectionGalleryContext.token,
|
||||
publicCollectionGalleryContext.passwordToken
|
||||
);
|
||||
try {
|
||||
await downloadFile(
|
||||
file,
|
||||
publicCollectionGalleryContext.accessedThroughSharedURL,
|
||||
publicCollectionGalleryContext.token,
|
||||
publicCollectionGalleryContext.passwordToken
|
||||
);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
appContext.finishLoading();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -206,12 +206,16 @@ export default function PublicCollectionGallery() {
|
|||
}
|
||||
appContext.startLoading();
|
||||
for (const file of publicFiles) {
|
||||
await downloadFile(
|
||||
file,
|
||||
true,
|
||||
token.current,
|
||||
passwordJWTToken.current
|
||||
);
|
||||
try {
|
||||
await downloadFile(
|
||||
file,
|
||||
true,
|
||||
token.current,
|
||||
passwordJWTToken.current
|
||||
);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
appContext.finishLoading();
|
||||
};
|
||||
|
|
|
@ -142,6 +142,7 @@ export async function downloadFile(
|
|||
}
|
||||
} catch (e) {
|
||||
logError(e, 'failed to download file');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue