I do not want to see Yii error message when the database connection fails.
How can I redirect to a specific page when the database connection fails with Yii framework?
Thanks.
I do not want to see Yii error message when the database connection fails.
Share
To catch all CDbConnection errors you need to enable an error handler in config/main.php
Then, within your controller (or an abstract base class for all your controllers) you need define an action to accomplish the redirect.
Alternatively you can just render your custom views:
See Yii docs for more details.