diff --git a/apps/photos/src/components/PhotoViewer/index.tsx b/apps/photos/src/components/PhotoViewer/index.tsx index a9ce93bdb..aee97d6f3 100644 --- a/apps/photos/src/components/PhotoViewer/index.tsx +++ b/apps/photos/src/components/PhotoViewer/index.tsx @@ -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(); } }; diff --git a/apps/photos/src/pages/shared-albums/index.tsx b/apps/photos/src/pages/shared-albums/index.tsx index 6baaa52cd..6ff7558d5 100644 --- a/apps/photos/src/pages/shared-albums/index.tsx +++ b/apps/photos/src/pages/shared-albums/index.tsx @@ -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(); }; diff --git a/apps/photos/src/utils/file/index.ts b/apps/photos/src/utils/file/index.ts index ec21d266e..a0003349f 100644 --- a/apps/photos/src/utils/file/index.ts +++ b/apps/photos/src/utils/file/index.ts @@ -142,6 +142,7 @@ export async function downloadFile( } } catch (e) { logError(e, 'failed to download file'); + throw e; } }