User friendly exception handling with symfony
on December 4, 2008The default behavior in symfony is that if an exception arises and is not handled then it will redirect the user to the error500.php page or show a stack trace. Even if is possible to override the error500.php page, we were in the need to provide custom messages to the user and also keep him inside the symfony application.
Multiple factors can make this problem to happen, like when the database server refuse our connection attempts or just because something went wrong in our php application. To overcome this issue we developed a plugin that tells the symfony exception handling mechanism to forward the user to a module/action specified in the configuration files.
In this way, we can keep with us all the benefits of the symfony rendering engine, all it’s helpers, etc.
The handler is made in such a way that we can specify a global default error action, or more detailed per module/action handlers. We can have all this coolness by just typing a few lines in the module.yml file or in the app.yml file :).
If you want to see the details of the usage please check the plugin page on the symfony website.






useful post! thx