aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-25 18:01:31 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-25 18:01:31 -0500
commite8dfb2f304afb423cf02d2edcfd98b6c817bac0c (patch)
treee53a78a6099de9c23442f4e30a22fcae23aa0053 /src/web
parent988eeec79212ce23eb498aff71134b8ae89576d6 (diff)
downloadslskd-e8dfb2f304afb423cf02d2edcfd98b6c817bac0c.tar.gz
handle errors gracefully
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/System/Shares/ContentsModal.jsx11
1 files changed, 10 insertions, 1 deletions
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)];