]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Fix rubocop style issues
[rails.git] / app / controllers / geocoder_controller.rb
index 25042c4744b3f8309a1115d317cdb6862a0b562a..37cdc6557af7660f19987023c5bce8aac79d6e66 100644 (file)
@@ -73,7 +73,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting rpc.geocoder.us: #{ex}"
     render :action => "error"
   end
@@ -99,7 +99,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting www.npemap.org.uk: #{ex}"
     render :action => "error"
   end
@@ -121,7 +121,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting geocoder.ca: #{ex}"
     render :action => "error"
   end
@@ -140,9 +140,7 @@ class GeocoderController < ApplicationController
     end
 
     # get objects to excude
-    if params[:exclude]
-      exclude = "&exclude_place_ids=#{params[:exclude]}"
-    end
+    exclude = "&exclude_place_ids=#{params[:exclude]}" if params[:exclude]
 
     # ask nominatim
     response = fetch_xml("http:#{NOMINATIM_URL}search?format=xml&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}")
@@ -188,7 +186,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-    #  rescue Exception => ex
+    #  rescue StandardError => ex
     #    @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}"
     #    render :action => "error"
   end
@@ -219,7 +217,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting ws.geonames.org: #{ex}"
     render :action => "error"
   end
@@ -251,7 +249,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting nominatim.openstreetmap.org: #{ex}"
     render :action => "error"
   end
@@ -281,7 +279,7 @@ class GeocoderController < ApplicationController
     end
 
     render :action => "results"
-  rescue Exception => ex
+  rescue StandardError => ex
     @error = "Error contacting ws.geonames.org: #{ex}"
     render :action => "error"
   end