Handle UrlGenerationError as an application exception rather than a
authorTom Clegg <tom@curoverse.com>
Mon, 23 Jun 2014 13:30:30 +0000 (09:30 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 23 Jun 2014 13:37:44 +0000 (09:37 -0400)
404, even though it subclasses RoutingError. refs #3047

apps/workbench/app/controllers/application_controller.rb

index 9e918f533f407c434da9e031c690c271c3a3bf81..22a5c49e0f0c1bce0b4cafb2d906286010029705 100644 (file)
@@ -16,16 +16,14 @@ class ApplicationController < ActionController::Base
   theme :select_theme
 
   begin
-    rescue_from Exception,
-    :with => :render_exception
-    rescue_from ActiveRecord::RecordNotFound,
-    :with => :render_not_found
-    rescue_from ActionController::RoutingError,
-    :with => :render_not_found
-    rescue_from ActionController::UnknownController,
-    :with => :render_not_found
-    rescue_from ::AbstractController::ActionNotFound,
-    :with => :render_not_found
+    rescue_from(ActiveRecord::RecordNotFound,
+                ActionController::RoutingError,
+                ActionController::UnknownController,
+                AbstractController::ActionNotFound,
+                with: :render_not_found)
+    rescue_from(Exception,
+                ActionController::UrlGenerationError,
+                with: :render_exception)
   end
 
   def unprocessable(message=nil)