]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Only apply data browser CSS rules in the data browser
[rails.git] / app / controllers / geocoder_controller.rb
index a4e1ded860d66916b2b2bbaba63aa7c1b4f59af3..2a3012892d736225d9c0fe86166cf529ae49f990 100644 (file)
@@ -286,7 +286,13 @@ class GeocoderController < ApplicationController
   private
 
   def fetch_text(url)
-    OSM.http_client.get(URI.parse(url)).body
+    response = OSM.http_client.get(URI.parse(url))
+
+    if response.success?
+      response.body
+    else
+      fail response.status.to_s
+    end
   end
 
   def fetch_xml(url)