Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Failsafe middleware doesn't render 500.html as ERB

#2715

500.html is actually an ERB template: it instructs the reader to read the appropriate log file to find out what went wrong, in case he's the administrator. This is good for usability because apparently a lot of people don't know that they're supposed to read the log file.

The Rescue middleware correctly renders 500.html as ERB, but the Failsafe middleware does not. This patch solves the problem, and also adds unit tests for Failsafe. It also makes the default static Failsafe response (which is returned in case ERB rendering fails as well) more friendly.

This patch is for Rails 2.3.

Reported by Hongli Lai · May 25th, 2009 @ 04:41 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Hongli Lai
    Hongli Lai
    • Tag set to 2-3-stable

    May 25th, 2009 @ 04:42 PM

  2. Hongli Lai
  3. CancelProfileIsBroken
    CancelProfileIsBroken

    ERB was removed from 500.html in 81c7a5d48d972c9e3973b4c018fafae1dfd9c0de and the code to render it was removed in 10b6073968eb43a3e20efd352d97d08720beeb12

    May 25th, 2009 @ 05:04 PM

  4. josh
    josh
    • Assigned user set to josh
    • State changed from new to open
    • Milestone cleared.

    May 25th, 2009 @ 05:26 PM

  5. Hongli Lai
    Hongli Lai

    Hm, I see. But it's still a huge usability issue. "Help my app says that something went wrong but I don't know what to do!" is one of the most often asked questions, and especially people who have little prior experience with administering Unix systems do not know that they're supposed to look in log files.

    Here's a new patch. It removes the ERB rendering but it retains the improved error messages.

    May 25th, 2009 @ 06:50 PM

  6. Pratik
    Pratik

    We shouldn't put "(If you're the administrator of this website, then please read this application's log file and/or the web server's log file to find out what went wrong.)" message. Especially after "we've been notified".

    May 26th, 2009 @ 01:54 PM

  7. Hongli Lai
    Hongli Lai

    What do you think would be the best message?

    May 26th, 2009 @ 03:00 PM

  8. Jeremy Kemper
    Jeremy Kemper

    I think it's a good change that gently pushes new Rails devs the right direction. Most production apps have replaced their 500.html with something better anyway.

    May 27th, 2009 @ 12:12 AM

  9. Repository
    Repository
    • State changed from open to resolved

    (from [34a1ed0df8311aba350043ec7ef373da3058855f]) Make the Failsafe middleware attempt to render 500.html during failsafe response rendering. Also make the default static failsafe response more friendly, in case 500.html rendering fails. [#2715 Failsafe middleware doesn't render 500.html as ERB state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com
    http://github.com/rails/rails/commit/34a1ed0df8311aba350043ec7ef373...

    May 27th, 2009 @ 09:02 PM