Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

chore(Upload):adding-logs-for-error-handling

Aswin Asoka97b09d27c7f
diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsx
index a7585cacd4..a27b7b79ec 100644
--- a/web/apps/photos/src/components/Upload.tsx
+++ b/web/apps/photos/src/components/Upload.tsx
@@ -618,7 +618,21 @@ export const Upload: React.FC<UploadProps> = ({
const uploadedFiles = successfulFilesFromUploadBatchResult(batchResult);
if (!uploadedFiles.length) return;
- await addOrCopyToCollection(targetCollection, uploadedFiles);
+ log.info(
+ `Adding ${uploadedFiles.length} uploaded file(s) to post-upload target collection ${targetCollection.id}`,
+ );
+ try {
+ await addOrCopyToCollection(targetCollection, uploadedFiles);
+ log.info(
+ `Added ${uploadedFiles.length} uploaded file(s) to post-upload target collection ${targetCollection.id}`,
+ );
+ } catch (e) {
+ log.error(
+ `Failed to add ${uploadedFiles.length} uploaded file(s) to post-upload target collection ${targetCollection.id}`,
+ e,
+ );
+ throw e;
+ }
};
const resetUploadUIState = () => {