[openstreetmap/openstreetmap-website] Map XML download with Turbo (PR #6255)

Tom Hughes notifications at github.com
Sun Jul 27 09:40:36 UTC 2025


@tomhughes commented on this pull request.



> +      try {
+        detailMessage = event?.detail?.error?.message;
+        if (!detailMessage) {
+          const responseText = await event.detail.fetchResponse.responseText;
+          const parser = new DOMParser();
+          const doc = parser.parseFromString(responseText, "text/html");
+          detailMessage = doc.body ? doc.body.textContent.trim() : "(unknown)";
+        }
+      } catch (err) {
+        detailMessage = "(unknown)";
+      }
+      // eslint-disable-next-line no-alert
+      alert(OSM.i18n.t("javascripts.share.export_failed", { reason: detailMessage }));
+    }
+
+    static getTurboBlobHandler(downloadCallback) {

Indeed, and once all that is done `downloadBlob` doesn't really need to be exported in `OSM` and could just be a function in the `DownloadUtil` class?

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

Message ID: <openstreetmap/openstreetmap-website/pull/6255/review/3059439038 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250727/3e330bed/attachment-0001.htm>


More information about the rails-dev mailing list