aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/App.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/App.js b/src/App.js
index 6676c38..cbaeae5 100755
--- a/src/App.js
+++ b/src/App.js
@@ -74,7 +74,12 @@ function genEventsGetter(calId, timeMin, timeMax) {
timeMin,
timeMax
}), { method: 'GET', async: true })
- .then(response => response.json())
+ .then(response => {
+ if (response.status == 200)
+ return response.json()
+ else throw `got response ${response.status}`;
+ })
+ .catch(e => { console.log(e); return []; })
.then(data => data.items);
}