We have a whole culture of training around resolving the WSOD. But why? It seems that we can output some simple information that would make it clear what has happened.
This is a proof-of-concept patch that demonstrates what can be done. It is deliberately simple; it attempts to not do anything that would cause more trouble or complexity. We could do more:
* A stack trace
* Fancier formatting
* A link for more help
* Output to watchdog().
Here's what the user would see in a simple fatal:

This is inspired by Marcelius 22-Jan-2009 01:41 comment on set_error_handler() and with DRUPAL_ROOT sanitization code borrowed from sun's excellent #1158322: Add backtrace to all errors.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | drupal-death-to-wsod-1159422-5.patch | 1.08 KB | traviscarden |
| rfay_screenshot_gazelle_Selection_004.png | 28.75 KB | rfay | |
| drupal.no_more_wsod.patch | 1.09 KB | rfay |
Comments
Comment #1
neclimdulI think this is generally because we don't like to show users code, or anything that they might think of as code(function names, file system paths etc.). We can already output error messages though when we need to and html_errors can provide better, prettier errors with markup, links and traces and its already in php. At least at this point I'm -1 to this.
Comment #2
wapnik commentedSome ideas around this have been discussed in #1135066: No more White Screen Of Death (graceful shutdown).
Comment #3
rfayIf you're testing: I created an error-creating fatal module for testing.
Comment #4
rfayWill need a reroll after the core patch went in.
Comment #5
traviscarden commentedHere's an updated patch to get the ball rolling again.
Comment #7
jhedstromIt seems like adding this would circumvent the entire point of hiding errors, which is for security reasons. Regardless, it's most likely too late for 8.0.
Comment #23
catchDuplicate of #1135066: No more White Screen Of Death (graceful shutdown).