aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/dispatcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/dispatcher.rb')
-rw-r--r--actionpack/lib/action_controller/dispatcher.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb
index 47199af2b4..110f9a88b1 100644
--- a/actionpack/lib/action_controller/dispatcher.rb
+++ b/actionpack/lib/action_controller/dispatcher.rb
@@ -182,13 +182,21 @@ module ActionController
end
def failsafe_rescue(exception)
- self.class.failsafe_response(@output, '500 Internal Server Error', exception) do
- if @controller ||= (::ApplicationController rescue Base)
- @controller.process_with_exception(@request, @response, exception).out(@output)
- else
- raise exception
+ if @test_request
+ process_with_exception(exception)
+ else
+ self.class.failsafe_response(@output, '500 Internal Server Error', exception) do
+ process_with_exception(exception)
end
end
end
+
+ def process_with_exception(exception)
+ if @controller ||= (::ApplicationController rescue Base)
+ @controller.process_with_exception(@request, @response, exception).out(@output)
+ else
+ raise exception
+ end
+ end
end
end