X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3d0ca940d26bdc23aa791178b01b816185c5a086..b38684e59eef299e82f5858fe1e14f6cf2aaa10a:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 41f724a34..f11700718 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -43,6 +43,7 @@ class AmfController < ApplicationController session :off before_filter :check_api_writable + around_filter :api_call_timeout, :only => [:amf_read] # Main AMF handlers: process the raw AMF string (using AMF library) and # calls each action (private method) accordingly. @@ -198,7 +199,7 @@ class AmfController < ApplicationController enlarge = [(xmax-xmin)/8,0.01].min xmin -= enlarge; ymin -= enlarge xmax += enlarge; ymax += enlarge - + # check boundary is sane and area within defined # see /config/application.yml check_boundaries(xmin, ymin, xmax, ymax) @@ -228,6 +229,8 @@ class AmfController < ApplicationController [0, ways, points, relations] + rescue OSM::APITimeoutError => err + [-1,"Sorry - I can't get the map for that area. The server said: #{err}"] rescue Exception => err [-2,"Sorry - I can't get the map for that area. The server said: #{err}"] end