Permalink
Browse files

Merge pull request #8600 from shime/patch-1

more descriptive return parameters
  • Loading branch information...
2 parents 61b91c4 + 7731fd8 commit 8fe1dfd2212cae114473da3a0074607ecf70e3ee @rafaelfranca rafaelfranca committed Dec 26, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
@@ -16,15 +16,14 @@ def initialize(app, routes_app = nil)
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

0 comments on commit 8fe1dfd

Please sign in to comment.