diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2012-02-22 17:43:13 +0200 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2012-02-22 17:43:13 +0200 |
commit | 10bac29b330ddda69102d43b77a1e7dba8741c45 (patch) | |
tree | d7fcc8b8ff486b59e3694e8e25b1f9e45be969e1 /actionpack | |
parent | 157ea763060e90f3aba0ff5af15d5dcb0f0c9c35 (diff) | |
download | rails-10bac29b330ddda69102d43b77a1e7dba8741c45.tar.gz rails-10bac29b330ddda69102d43b77a1e7dba8741c45.tar.bz2 rails-10bac29b330ddda69102d43b77a1e7dba8741c45.zip |
AS::Callbacks: deprecate rescuable option
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/callbacks.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/callbacks.rb b/actionpack/lib/action_dispatch/middleware/callbacks.rb index 8c0f4052ec..338b116940 100644 --- a/actionpack/lib/action_dispatch/middleware/callbacks.rb +++ b/actionpack/lib/action_dispatch/middleware/callbacks.rb @@ -5,7 +5,7 @@ module ActionDispatch class Callbacks include ActiveSupport::Callbacks - define_callbacks :call, :rescuable => true + define_callbacks :call class << self delegate :to_prepare, :to_cleanup, :to => "ActionDispatch::Reloader" @@ -24,9 +24,15 @@ module ActionDispatch end def call(env) - run_callbacks :call do - @app.call(env) + error = nil + result = run_callbacks :call do + begin + @app.call(env) + rescue => error + end end + raise error if error + result end end end |