diff options
-rw-r--r-- | main.js | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -3870,7 +3870,14 @@ const [vectorLayers, featureOverlayLayer] = (function() { headers: { 'Content-Type': 'application/json; charset=UTF-8' } - }).then((resp) => resp.json()) + }) + .then(function(resp) { + if (resp.status === 200) { + return resp.json(); + } else { + throw new Error(`${resp.url} [${resp.status}]`); + } + }) .then(function(data) { /* the data is received from the CGI in the order it was sent */ /* TODO optimizations on the CGI would break the above assumption, so the @@ -3916,6 +3923,9 @@ const [vectorLayers, featureOverlayLayer] = (function() { popover.tip.classList.remove('inprogress'); } }) + .catch(function(e) { + console.log(e); + }) .finally(function() { document.body.classList.remove('inprogress'); }); |