diff options
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rescue_with_helper.rb | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 1a2cbaab65..9616aa1639 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -49,7 +49,9 @@ module ActionController AbstractController::Callbacks, # The same with rescue, append it at the end to wrap as much as possible. - Rescue + Rescue, + + RescueWithHelper ] MODULES.each do |mod| @@ -69,4 +71,4 @@ module ActionController end end -require "action_controller/deprecated/base"
\ No newline at end of file +require "action_controller/deprecated/base" diff --git a/actionpack/lib/action_controller/metal/rescue_with_helper.rb b/actionpack/lib/action_controller/metal/rescue_with_helper.rb new file mode 100644 index 0000000000..7894deaeef --- /dev/null +++ b/actionpack/lib/action_controller/metal/rescue_with_helper.rb @@ -0,0 +1,14 @@ +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 |