]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/amf_controller.rb
Fix Style/ExplicitBlockArgument warnings
[rails.git] / app / controllers / api / amf_controller.rb
index c05a130981cdf46bb97cea3af2dca125362822dd..fc8a304bbc56513fbe1d1ce089e1354e7621e627 100644 (file)
@@ -128,11 +128,9 @@ module Api
       [-2, "An unusual error happened (in #{call}). The server said: #{e}"]
     end
 
       [-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
       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
 
       end
     end