aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/dispatcher.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-12-04 01:24:24 -0600
committerJoshua Peek <josh@joshpeek.com>2008-12-04 09:43:06 -0600
commit40e9ba1e4627f1939153e7a061aaf060c87ec902 (patch)
treeff8df6462d8d9514dfbe851ce0f7fcbd4685365e /actionpack/lib/action_controller/dispatcher.rb
parent57f0b9738e71016d8a9898d83fe39b2310bf6c91 (diff)
downloadrails-40e9ba1e4627f1939153e7a061aaf060c87ec902.tar.gz
rails-40e9ba1e4627f1939153e7a061aaf060c87ec902.tar.bz2
rails-40e9ba1e4627f1939153e7a061aaf060c87ec902.zip
Refactor SessionFixationTest and WebServiceTest with IntegrationTest so they are compatible with the Rack interface.
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