I am working on a Symfony project and I am trying to create user-friendly error pages for the production environment. To do this, I have overridden the twig.exception_controller
parameter. That process is described in the Symfony Documentation. In overriding the exception controller, I have been able to create custom error pages for instances were no routes exist, or an uncaught exception in thrown. I have not been able to get this to work with fatal errors, and that is what my question is about.
Is it possible to catch/handle fatal errors in Symfony? I am not attempting to continue running the application (as the answerer of this question suggests) when a fatal error occurs. I would simply like to show an error page, aside from the standard one which has the function-call stack trace.
I attempted to set the shutdown function using register_shutdown_function
, but that did not prevent the default error page (with stack trace) from displaying.
Thanks!