aboutsummaryrefslogtreecommitdiffstats
path: root/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'main.js')
-rw-r--r--main.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.js b/main.js
index 88ac044..231f492 100644
--- a/main.js
+++ b/main.js
@@ -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');
});