From ab6ff859067b35bda62e9a92fcd710cf925ba2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 19 Jul 2010 14:49:20 +0200 Subject: No need to create a new module in the previous commit. --- actionpack/lib/action_controller.rb | 1 - actionpack/lib/action_controller/base.rb | 4 +--- actionpack/lib/action_controller/metal/rescue.rb | 9 +++++++++ .../lib/action_controller/metal/rescue_with_helper.rb | 14 -------------- 4 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 actionpack/lib/action_controller/metal/rescue_with_helper.rb (limited to 'actionpack') diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 1b23a8e916..1bd4572a47 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -28,7 +28,6 @@ module ActionController autoload :Rendering autoload :RequestForgeryProtection autoload :Rescue - autoload :RescueWithHelper autoload :Responder autoload :SessionManagement autoload :Streaming diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 9616aa1639..cfe6b30add 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -49,9 +49,7 @@ module ActionController AbstractController::Callbacks, # The same with rescue, append it at the end to wrap as much as possible. - Rescue, - - RescueWithHelper + Rescue ] MODULES.each do |mod| diff --git a/actionpack/lib/action_controller/metal/rescue.rb b/actionpack/lib/action_controller/metal/rescue.rb index bbca1b2179..cc2b020e03 100644 --- a/actionpack/lib/action_controller/metal/rescue.rb +++ b/actionpack/lib/action_controller/metal/rescue.rb @@ -3,6 +3,15 @@ module ActionController #:nodoc: extend ActiveSupport::Concern include ActiveSupport::Rescuable + def rescue_with_handler(exception) + if ((exception.respond_to?(:original_exception)) && + (orig_exception = exception.original_exception) && + (orig_handler = handler_for_rescue(orig_exception))) + exception = orig_exception + end + super(exception) + end + private def process_action(*args) super diff --git a/actionpack/lib/action_controller/metal/rescue_with_helper.rb b/actionpack/lib/action_controller/metal/rescue_with_helper.rb deleted file mode 100644 index 7894deaeef..0000000000 --- a/actionpack/lib/action_controller/metal/rescue_with_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -module ActionController #:nodoc: - module RescueWithHelper - - def rescue_with_handler(exception) - if ((exception.class == ActionView::TemplateError) && - (orig_exception = exception.original_exception) && - (orig_handler = handler_for_rescue(orig_exception))) - exception = orig_exception - end - super(exception) - end - - end -end -- cgit v1.2.3