diff options
Diffstat (limited to 'modern/src/CachingController.js')
-rw-r--r-- | modern/src/CachingController.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modern/src/CachingController.js b/modern/src/CachingController.js index d6e20060..1c8fb43a 100644 --- a/modern/src/CachingController.js +++ b/modern/src/CachingController.js @@ -14,6 +14,8 @@ const CachingController = () => { const response = await fetch('/api/geofences'); if (response.ok) { dispatch(geofencesActions.update(await response.json())); + } else { + throw Error(await response.text()); } } }, [authenticated]); @@ -23,6 +25,8 @@ const CachingController = () => { const response = await fetch('/api/groups'); if (response.ok) { dispatch(groupsActions.update(await response.json())); + } else { + throw Error(await response.text()); } } }, [authenticated]); @@ -32,6 +36,8 @@ const CachingController = () => { const response = await fetch('/api/drivers'); if (response.ok) { dispatch(driversActions.update(await response.json())); + } else { + throw Error(await response.text()); } } }, [authenticated]); @@ -41,6 +47,8 @@ const CachingController = () => { const response = await fetch('/api/maintenance'); if (response.ok) { dispatch(maintenancesActions.update(await response.json())); + } else { + throw Error(await response.text()); } } }, [authenticated]); |