[openstreetmap/openstreetmap-website] Check response.ok before parsing JSON in query tool (PR #6724)

Marwin Hochfelsner notifications at github.com
Wed Jan 21 15:41:36 UTC 2026


hlfan left a comment (openstreetmap/openstreetmap-website#6724)

I was thinking of something like

```js
        throw new Error("Response not OK", { cause: {
          status: response.status,
          statusText: response.statusText,
          text: await response.text()
        } });
```

and handle that in the `catch` block in the vicinity of this code

https://github.com/openstreetmap/openstreetmap-website/blob/70c2269f5b9c7112998d6443c038591f23763425/app/assets/javascripts/index/query.js#L243

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6724#issuecomment-3778963538
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6724/c3778963538 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260121/cbb6c782/attachment.htm>


More information about the rails-dev mailing list