diff options
author | Determinant <[email protected]> | 2019-01-29 20:27:25 -0500 |
---|---|---|
committer | Determinant <[email protected]> | 2019-01-29 20:27:25 -0500 |
commit | d9720829424f01bedfd2edc5cb6682c820566a2b (patch) | |
tree | 8ba2911856eb8f0c1f6f6355a9df0df76c08fa59 /src | |
parent | cdb0a759a61780854fb89589a65c069690d41d75 (diff) |
catch genEventsGetter errors
Diffstat (limited to 'src')
-rwxr-xr-x | src/App.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |