From 7e96816f94314dcdf071eeee6e74a95bcace329f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 21 May 2022 09:49:26 -0700 Subject: Implement API error handling --- modern/src/settings/GroupsPage.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modern/src/settings/GroupsPage.js') diff --git a/modern/src/settings/GroupsPage.js b/modern/src/settings/GroupsPage.js index 5d23c2d9..257d0bca 100644 --- a/modern/src/settings/GroupsPage.js +++ b/modern/src/settings/GroupsPage.js @@ -26,6 +26,8 @@ const GroupsView = ({ updateTimestamp, onMenuClick }) => { const response = await fetch('/api/groups'); if (response.ok) { setItems(await response.json()); + } else { + throw Error(await response.text()); } }, [updateTimestamp]); -- cgit v1.2.3