diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-19 14:49:20 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-19 14:50:38 +0200 |
commit | ab6ff859067b35bda62e9a92fcd710cf925ba2df (patch) | |
tree | d2b8b35a9a36c9d63f81b4606f90fbf11498c11c /actionpack/lib/action_controller/metal | |
parent | 33c5689e2d04aa08759903bc5d1e4de3bf6c35dd (diff) | |
download | rails-ab6ff859067b35bda62e9a92fcd710cf925ba2df.tar.gz rails-ab6ff859067b35bda62e9a92fcd710cf925ba2df.tar.bz2 rails-ab6ff859067b35bda62e9a92fcd710cf925ba2df.zip |
No need to create a new module in the previous commit.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/rescue.rb | 9 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rescue_with_helper.rb | 14 |
2 files changed, 9 insertions, 14 deletions
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 |