aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-01-29 20:27:25 -0500
committerDeterminant <ted.sybil@gmail.com>2019-01-29 20:27:25 -0500
commitd9720829424f01bedfd2edc5cb6682c820566a2b (patch)
tree8ba2911856eb8f0c1f6f6355a9df0df76c08fa59 /src
parentcdb0a759a61780854fb89589a65c069690d41d75 (diff)
catch genEventsGetter errors
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);
}