I’m working on a Symfony Bundle in order to add an AI recommandation when an Exception occurs, in the debug page (dev. mode).
To do that, I have followed the Symfony Documentation and created a custom controller to handle Exception.
This is a working example of the result :
However, this controller is not called when other exception occurs, such as PHP Syntax errors :
I’ve tried to create multiple listeners on different events (kernel.exception for example), but none of them is called when this type of Exception (PHP syntax) occurs.
Do you know how can I collect and handle ALL exceptions that occurs to a Symfony project ?
Thank you 🙂
2
Answers
following up :
https://github.com/acseo/AIErrorExplainedBundle
This Bundle proposes to override the default ErrorHandler (in dev mode) to add AI recommandation to solve the encountered error.
it is in beta, feel free to install it, test it, and give me feedback about it 🙂
Error pages for the production environment can be customized in different ways depending on your needs:
This is the default controller that you need to overwrite if you want to implement point 3.
This is the sample code if you want to implement point 4