diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-03-07 07:27:54 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-03-07 07:27:54 +0000 |
commit | 31a499ac2713e3fbacda32de037f4af419152658 (patch) | |
tree | 23607c645a19a5d0ac3e9b536cf5568f36fb278a | |
parent | 6fd737b76b7024fbc7d27f99139c9a0d052b1fc3 (diff) | |
download | rails-31a499ac2713e3fbacda32de037f4af419152658.tar.gz rails-31a499ac2713e3fbacda32de037f4af419152658.tar.bz2 rails-31a499ac2713e3fbacda32de037f4af419152658.zip |
Added a backtrace to the evil WSOD (White Screen of Death). Closes #4073. TODO: Clearer exceptions [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3809 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/dispatcher.rb | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 3a0b3ce5e0..26a9057cf5 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added a backtrace to the evil WSOD (White Screen of Death). Closes #4073. TODO: Clearer exceptions [Rick Olson] + * Added tracking of database and framework versions in script/about #4088 [charles.gerungan@gmail.com/Rick Olson] * Added public/javascripts/application.js as a sample since it'll automatically be included in javascript_include_tag :defaults [DHH] diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index d4f644ecc9..f3350087ad 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -38,7 +38,7 @@ class Dispatcher ActionController::Routing::Routes.recognize!(request).process(request, response).out(output) end rescue Object => exception - failsafe_response(output, '500 Internal Server Error') do + failsafe_response(output, '500 Internal Server Error', exception) do ActionController::Base.process_with_exception(request, response, exception).out(output) end ensure @@ -85,11 +85,13 @@ class Dispatcher end # If the block raises, send status code as a last-ditch response. - def failsafe_response(output, status) + def failsafe_response(output, status, exception) yield rescue Object begin output.write "Status: #{status}\r\n" + output.write "Content-Type: text/plain\r\n\r\n" + output.write exception.to_s + "\r\n" + exception.backtrace.join("\r\n") rescue Object end end |