Score:0

How can I make a white screen of death less ugly

ao flag

A project I'm working on requires custom modules, and I'll be the last person to claim that I am perfect. I've gone through and removed as many possible php errors and causes for WSODs that I can think of, and I haven't had any recently. In the case that an error does happen with my code it will affect a single page load, it won't totally take the site down. The last thing I want is a user seeing a clearly broken page with text saying "your website is broken".

Is there a way I can display/redirect to a general (and pretty) "There was a problem completing your request, please contact site administrators" error page?

Kevin avatar
in flag
Use try / catch statements on the offending code to recover as gracefully as possible. But no, in the event of a 500 error, this is usually done at the server level (maintenance page) because the application cannot complete the request.
john Smith avatar
gr flag
you could also make use of an eventlistener and listen for `'onKernelException'` and check the response-code
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.