X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/293fe68eff1923a00992e0a195ba025ab7bd9efa..75e135869e26a1aeae93f3334668de01c3bb2f69:/app/controllers/api/amf_controller.rb?ds=sidebyside diff --git a/app/controllers/api/amf_controller.rb b/app/controllers/api/amf_controller.rb index c05a13098..fc8a304bb 100644 --- a/app/controllers/api/amf_controller.rb +++ b/app/controllers/api/amf_controller.rb @@ -128,11 +128,9 @@ module Api [-2, "An unusual error happened (in #{call}). The server said: #{e}"] end - def amf_handle_error_with_timeout(call, rootobj, rootid) + def amf_handle_error_with_timeout(call, rootobj, rootid, &block) amf_handle_error(call, rootobj, rootid) do - OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError) do - yield - end + OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError, &block) end end