aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rescue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/rescue.rb')
-rw-r--r--actionpack/lib/action_controller/rescue.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb
index 628190d606..ec8e9b92d5 100644
--- a/actionpack/lib/action_controller/rescue.rb
+++ b/actionpack/lib/action_controller/rescue.rb
@@ -43,6 +43,10 @@ module ActionController #:nodoc:
base.extend(ClassMethods)
base.send :include, ActiveSupport::Rescuable
+
+ base.class_eval do
+ alias_method_chain :perform_action, :rescue
+ end
end
module ClassMethods
@@ -128,6 +132,12 @@ module ActionController #:nodoc:
end
private
+ def perform_action_with_rescue #:nodoc:
+ perform_action_without_rescue
+ rescue Exception => exception
+ rescue_action(exception)
+ end
+
def rescues_path(template_name)
"#{File.dirname(__FILE__)}/templates/rescues/#{template_name}.erb"
end