diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-26 06:41:56 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-26 06:41:56 -0800 |
commit | 8fe1dfd2212cae114473da3a0074607ecf70e3ee (patch) | |
tree | 9b878389a46c1aa7eb06acd4cfed8ed212ebfaa4 /actionpack/lib | |
parent | 61b91c4c55bcbd5a2ec85d6e1c67755150653dff (diff) | |
parent | 7731fd86b1d2cc2b218def476cebb683c9d75d0c (diff) | |
download | rails-8fe1dfd2212cae114473da3a0074607ecf70e3ee.tar.gz rails-8fe1dfd2212cae114473da3a0074607ecf70e3ee.tar.bz2 rails-8fe1dfd2212cae114473da3a0074607ecf70e3ee.zip |
Merge pull request #8600 from shime/patch-1
more descriptive return parameters
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index 1dc51d62e0..287b4ce2ff 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -16,15 +16,14 @@ module ActionDispatch def call(env) begin - response = @app.call(env) + response = (_, headers, body = @app.call(env)) - if response[1]['X-Cascade'] == 'pass' - body = response[2] + if headers['X-Cascade'] == 'pass' body.close if body.respond_to?(:close) raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}" end rescue Exception => exception - raise exception if env['action_dispatch.show_exceptions'] == false + raise exception unless env['action_dispatch.show_exceptions'] end exception ? render_exception(env, exception) : response |