From 98222b992d1144275c97c4a28dd4ba3430e236ae Mon Sep 17 00:00:00 2001 From: Jasmine <55065445+jyuenbeep@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:09:46 -0800 Subject: [PATCH] Try-catch fixed --- src/components/FileUpload.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FileUpload.tsx b/src/components/FileUpload.tsx index 9bd4b42..88a95ed 100644 --- a/src/components/FileUpload.tsx +++ b/src/components/FileUpload.tsx @@ -75,7 +75,7 @@ const FileUpload: React.FC = ({ uploadUrl }) => { console.error("Upload failed:", error); setError("An error occurred while uploading. Please try again."); } - } else { + } catch (error) { setError("Please select files to upload."); } };