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

Marwin Hochfelsner notifications at github.com
Thu Aug 28 02:30:19 UTC 2025


@hlfan 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) {

To ignore deleted element response errors:
```suggestion
          if (![400, 410, 509].includes(response.status)) {
```

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

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


More information about the rails-dev mailing list