I’m developing my app against Ror 2.0, and I noticed my public/
500.html page was not rendered in response to some low level errors
(like when I stopped MySql). So I did some debugging to figure out
why. After some digging I think I’m seeing a bug in the way
dispatcher.rb looks for the error pages.
This seems incredible to me. How could such a basic bug not be
detected?
But the code I’m looking at sure looks wrong. The filename it
constructs for the 500.html page has an extra space in it: “public/
500 .html”
Here’s my diff:
C:\projects[…]\vendor\rails>svn diff .
Index: actionpack/lib/action_controller/dispatcher.rb
— actionpack/lib/action_controller/dispatcher.rb (revision
9641)
+++ actionpack/lib/action_controller/dispatcher.rb (working copy)
@@ -61,7 +61,7 @@
private
def failsafe_response_body(status)
-
error_path = "#{error_file_path}/#{status.to_s[0..3]}.html"
-
error_path = "#{error_file_path}/#{status}.html" if File.exist?(error_path) File.read(error_path)
I’ve tested this on WinXP and OS X with the same results. I tried
searching this group and the lighthouse bug db, but I see no other
references to this problem… I did find a 9-month old Trac ticket
reporting this problem, but the old Trac system is obsolete, right?
(http://dev.rubyonrails.org/ticket/9305) What am I missing?