aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rescue.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-11-20 04:50:34 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-11-20 04:50:34 +0530
commitdbbaccbcda7475766919723dda53c0f92afddc4b (patch)
tree0e676f7752a4817b6e936628161e03e35b0c2b29 /actionpack/lib/action_controller/rescue.rb
parent3be9134d1cb882f4be3be8d57b2f8bde5ecde887 (diff)
downloadrails-dbbaccbcda7475766919723dda53c0f92afddc4b.tar.gz
rails-dbbaccbcda7475766919723dda53c0f92afddc4b.tar.bz2
rails-dbbaccbcda7475766919723dda53c0f92afddc4b.zip
Revert "Simplify benchmarking and rescue". Need a different approach.
This reverts commit 3be9134d1cb882f4be3be8d57b2f8bde5ecde887.
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