diff options
author | Hrvoje Šimić <shime.ferovac@gmail.com> | 2012-12-26 14:17:11 +0100 |
---|---|---|
committer | Hrvoje Šimić <shime.ferovac@gmail.com> | 2012-12-26 14:17:11 +0100 |
commit | 7731fd86b1d2cc2b218def476cebb683c9d75d0c (patch) | |
tree | 1139ff834221acb381656e7c707eb14e4c91a1e6 /actionpack/lib | |
parent | 0a752e88c2c484241d7fd0cd911b36c4b02a59d1 (diff) | |
download | rails-7731fd86b1d2cc2b218def476cebb683c9d75d0c.tar.gz rails-7731fd86b1d2cc2b218def476cebb683c9d75d0c.tar.bz2 rails-7731fd86b1d2cc2b218def476cebb683c9d75d0c.zip |
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 |