I was just wandering how can we catch the error sent by Symfony when the database is down, due to a problem with the web host for exemple.
In exemple, it would allow me to redirect the user on a specific page if my database is not found .
Should i use try{}catch{} somwhere in the doctrine code to catch any error during the connection?
You can create event listener for kernel.exception event which would get this exception and change the response for user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With