aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-25 18:01:04 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-25 18:01:04 -0500
commit988eeec79212ce23eb498aff71134b8ae89576d6 (patch)
tree76b904565cc78ee8e450f8d22d140ee42bea2d23
parent778f0dd4569fe19c304fca5a6d32360be7ffffb8 (diff)
downloadslskd-988eeec79212ce23eb498aff71134b8ae89576d6.tar.gz
catch errors when clearing data
-rw-r--r--src/web/src/components/System/Data/index.jsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/web/src/components/System/Data/index.jsx b/src/web/src/components/System/Data/index.jsx
index 8b6a99eb..2424ea87 100644
--- a/src/web/src/components/System/Data/index.jsx
+++ b/src/web/src/components/System/Data/index.jsx
@@ -5,9 +5,15 @@ import { Button, Divider, Header, Icon } from 'semantic-ui-react';
const clear = async ({ direction, setState }) => {
setState(true);
- await clearCompleted({ direction });
- setState(false);
- toast.success(`Completed ${direction}s cleared!`);
+
+ try {
+ await clearCompleted({ direction });
+ toast.success(`Completed ${direction}s cleared!`);
+ } catch (error) {
+ toast.error(error?.response?.data ?? error?.message ?? error);
+ } finally {
+ setState(false);
+ }
};
const Data = () => {