From 7f318c3ec535afe53733c55cd0ecaccc16a8b944 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 16 May 2009 14:15:26 -0400 Subject: Instead of checking Rails.env.test? in Failsafe middleware, check env["rails.raise_exceptions"] --- actionpack/lib/action_dispatch/middleware/failsafe.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware') diff --git a/actionpack/lib/action_dispatch/middleware/failsafe.rb b/actionpack/lib/action_dispatch/middleware/failsafe.rb index 836098482c..389accbc36 100644 --- a/actionpack/lib/action_dispatch/middleware/failsafe.rb +++ b/actionpack/lib/action_dispatch/middleware/failsafe.rb @@ -10,9 +10,8 @@ module ActionDispatch def call(env) @app.call(env) rescue Exception => exception - # Reraise exception in test environment - if defined?(Rails) && Rails.env.test? - raise exception + if env["rails.raise_exceptions"] + raise else failsafe_response(exception) end -- cgit v1.2.3