From e8dfb2f304afb423cf02d2edcfd98b6c817bac0c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 25 Oct 2026 18:01:31 -0500 Subject: handle errors gracefully --- src/web/src/components/System/Shares/ContentsModal.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/web/src/components/System/Shares/ContentsModal.jsx b/src/web/src/components/System/Shares/ContentsModal.jsx index 5399bcf2..36d1d79d 100644 --- a/src/web/src/components/System/Shares/ContentsModal.jsx +++ b/src/web/src/components/System/Shares/ContentsModal.jsx @@ -13,7 +13,16 @@ const ContentsModal = ({ onClose, share, theme }) => { const fetch = async () => { setLoading(true); - const result = await browse({ id }); + let result; + + try { + result = await browse({ id }); + } catch (error) { + console.error(error); + setContents(error?.response?.data ?? error?.message ?? String(error)); + setLoading(false); + return; + } const directories = result.map((directory) => { const lines = [directory.name.replace(remotePath, localPath)]; -- cgit v1.2.3