0

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?

2
  • 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.
    – Kevin
    Jan 6, 2022 at 4:41
  • you could also make use of an eventlistener and listen for 'onKernelException' and check the response-code
    – john Smith
    Jan 18, 2022 at 9:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.