diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2025-05-27 22:46:00 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2025-05-27 22:46:14 +0200 |
commit | ee2e82b8405541b4a711050117bd58bfc82e2db5 (patch) | |
tree | 64de804d51c4748ab5110ac631045a06297d87cf | |
parent | 1e67d1de88b5dcafe56db2a28c26750daa50c5f8 (diff) |
-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'); }); |