]> git.openstreetmap.org Git - rails.git/commitdiff
Add an error handler for overpass AJAX calls
authorTom Hughes <tom@compton.nu>
Mon, 17 Mar 2014 00:24:29 +0000 (00:24 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 17 Mar 2014 00:24:29 +0000 (00:24 +0000)
app/assets/javascripts/index/query.js
config/locales/en.yml

index d9906407d11ead6a476d1187025d14c874640922..f2281d007050096af259f79e73b9ff15f58bc837 100644 (file)
@@ -198,6 +198,13 @@ OSM.Query = function(map) {
             .text(I18n.t("javascripts.query.nothing_found"))
             .appendTo($ul);
         }
+      },
+      error: function(xhr, status, error) {
+        $section.find(".loader").stopTime("loading").hide();
+
+        $("<li>")
+          .text(I18n.t("javascripts.query." + status, { server: OSM.OVERPASS_URL, error: error }))
+          .appendTo($ul);
       }
     }));
   }
index c4f757b76180f3ed1b811e8413fe94bb041b167c..3e452571bbdbbc4425737feb4ea2937d9fa9aba9 100644 (file)
@@ -2127,6 +2127,8 @@ en:
       way: Way
       relation: Relation
       nothing_found: No features found
+      error: "Error contacting %{server}: %{error}"
+      timeout: "Timeout contacting %{server}"
   redaction:
     edit:
       description: "Description"