Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Catching Database Connection Error And Showing An Alternate Error Page

$
0
0
When Yii isn't able to connect to DB i get an error like:
CDbException
CDbConnection failed to open the DB connection

I find it ugly and it could scare away a noob user, regardless it also displays a little information about the error to frontend user which in my option is a bad practice. I have tested and site/error (the error handler i set) isn't being called. This exception is happening somewhere outside.

Is there a way i could catch it and display an alternate error page, or redirect to site/error?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>