diff options
author | José Valim <jose.valim@gmail.com> | 2012-02-22 07:55:54 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-02-22 07:55:54 -0800 |
commit | f28d9f15482addeb95ab05545b7a8467a4e0182d (patch) | |
tree | d7fcc8b8ff486b59e3694e8e25b1f9e45be969e1 /actionpack/lib/action_dispatch | |
parent | 157ea763060e90f3aba0ff5af15d5dcb0f0c9c35 (diff) | |
parent | 10bac29b330ddda69102d43b77a1e7dba8741c45 (diff) | |
download | rails-f28d9f15482addeb95ab05545b7a8467a4e0182d.tar.gz rails-f28d9f15482addeb95ab05545b7a8467a4e0182d.tar.bz2 rails-f28d9f15482addeb95ab05545b7a8467a4e0182d.zip |
Merge pull request #5128 from bogdan/deprecate_rescuable
AS::Callbacks: deprecate rescuable option
Diffstat (limited to 'actionpack/lib/action_dispatch')
-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 |