提交 144f78be 编写于 作者: J Jeremy Kemper

Move Dispatcher.dispatch CGI.new out of default args and into rescuable block...

Move Dispatcher.dispatch CGI.new out of default args and into rescuable block so the dispatcher catches its errors rather than the fcgi handler.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 30b9d6d2
*SVN* *SVN*
* Move Dispatcher.dispatch CGI.new out of default args and into rescuable block so the dispatcher catches its errors rather than the fcgi handler. [Jeremy Kemper]
* The freeze_gems Rake task accepts the VERSION environment variable to decide which version of Rails to pull into vendor/rails. [Chad Fowler, Jeremy Kemper] * The freeze_gems Rake task accepts the VERSION environment variable to decide which version of Rails to pull into vendor/rails. [Chad Fowler, Jeremy Kemper]
* Removed script.aculo.us.js, builder.js and slider.js (preperation for move of scriptaculous extensions to plugins, core scriptaculous will remain in Railties) [Thomas Fuchs] * Removed script.aculo.us.js, builder.js and slider.js (preperation for move of scriptaculous extensions to plugins, core scriptaculous will remain in Railties) [Thomas Fuchs]
......
...@@ -26,19 +26,19 @@ ...@@ -26,19 +26,19 @@
# the environment (when Dependencies.load? is true) after each request. # the environment (when Dependencies.load? is true) after each request.
class Dispatcher class Dispatcher
class << self class << self
# Dispatch the given CGI request, using the given session options, and # Dispatch the given CGI request, using the given session options, and
# emitting the output via the given output. # emitting the output via the given output. If you dispatch with your
def dispatch(cgi = CGI.new, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout) # own CGI object, be sure to handle the exceptions it raises.
begin def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout)
request, response = ActionController::CgiRequest.new(cgi, session_options), ActionController::CgiResponse.new(cgi) cgi ||= CGI.new
prepare_application request, response = ActionController::CgiRequest.new(cgi, session_options), ActionController::CgiResponse.new(cgi)
ActionController::Routing::Routes.recognize!(request).process(request, response).out(output) prepare_application
rescue Object => exception ActionController::Routing::Routes.recognize!(request).process(request, response).out(output)
ActionController::Base.process_with_exception(request, response, exception).out(output) rescue Object => exception
ensure ActionController::Base.process_with_exception(request, response, exception).out(output)
reset_after_dispatch ensure
end reset_after_dispatch
end end
# Reset the application by clearing out loaded controllers, views, actions, # Reset the application by clearing out loaded controllers, views, actions,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册