[openstreetmap/openstreetmap-website] Added error handling for object display on map (PR #6353)

mmd notifications at github.com
Thu Aug 28 05:54:49 UTC 2025


@mmd-osm commented on this pull request.



> @@ -277,7 +278,19 @@ L.OSM.Map = L.Map.extend({
         headers: { accept: "application/json" },
         signal: this._objectLoader.signal
       })
-        .then(response => response.json())
+        .then(async response => {
+          if (response.ok) {
+            return response.json();
+          }
+
+          const status = response.statusText || response.status;
+          if (response.status !== 400 && response.status !== 509) {

No, this will not work and only change the error text itself.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6353/review/3163265917 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250827/723db3b3/attachment.htm>


More information about the rails-dev mailing list