diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-25 18:01:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-25 18:01:31 -0500 |
| commit | e8dfb2f304afb423cf02d2edcfd98b6c817bac0c (patch) | |
| tree | e53a78a6099de9c23442f4e30a22fcae23aa0053 /src | |
| parent | 988eeec79212ce23eb498aff71134b8ae89576d6 (diff) | |
| download | slskd-e8dfb2f304afb423cf02d2edcfd98b6c817bac0c.tar.gz | |
handle errors gracefully
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/System/Shares/ContentsModal.jsx | 11 |
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)]; |
