]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
ActionController::UnknownAction is now AbstractController::ActionNotFound
[rails.git] / app / controllers / application_controller.rb
index e64e2e022fca6b92ef8d5f464206195e8d405e2c..3d3c11d79ea588f0bd116179552e04afac496530 100644 (file)
@@ -266,7 +266,7 @@ class ApplicationController < ActionController::Base
       report_error message, :bad_request
     rescue OSM::APIError => ex
       report_error ex.message, ex.status
-    rescue ActionController::UnknownAction => ex
+    rescue AbstractController::ActionNotFound => ex
       raise
     rescue Exception => ex
       logger.info("API threw unexpected #{ex.class} exception: #{ex.message}")
@@ -299,8 +299,14 @@ class ApplicationController < ActionController::Base
     OSM::Timer.timeout(WEB_TIMEOUT) do
       yield
     end
-  rescue ActionView::TemplateError => ex
-    if ex.original_exception.is_a?(Timeout::Error)
+  rescue ActionView::Template::Error => ex
+    ex = ex.original_exception
+
+    if ex.is_a?(ActiveRecord::StatementInvalid) and ex.message =~ /^Timeout::Error/
+      ex = Timeout::Error.new
+    end
+
+    if ex.is_a?(Timeout::Error)
       render :action => "timeout"
     else
       raise