symfony2 - Handling Fatal Errors with the Twig Exception Controller -



symfony2 - Handling Fatal Errors with the Twig Exception Controller -

i working on symfony project , trying create user-friendly error pages production environment. this, have overridden twig.exception_controller parameter. process described in symfony documentation. in overriding exception controller, have been able create custom error pages instances no routes exist, or uncaught exception in thrown. have not been able work fatal errors, , question about.

is possible catch/handle fatal errors in symfony? not attempting go on running application (as answerer of question suggests) when fatal error occurs. show error page, aside standard 1 has function-call stack trace.

i attempted set shutdown function using register_shutdown_function, did not prevent default error page (with stack trace) displaying.

thanks!

you can set proccesses might fail seek block

try { // assert fails because have buggy code here $foos=$fooservice->getfoosbydatetime(); }catch(\exception $e){ //you can grab exception $exceptionmessage= $e->getmessage(); $this->redirect("your_custom_route_to_error_page",{"error":$exceptionmessage}); }

symfony2 fatal-error

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -