Hide password on error in debug mode

I encountered the following problem: if you get Yii error and Yii is in debug mode, it shows config file information, which is fine, but it also shows the database password. Is there a way to hide it?

The reason why I am using Yii in debug mode on production server is that the site still has quirks to iron out and the debug mode helps me tremendously. If there is a better way to do it, please let me know.

One possible solution:

Create a subdomain or subdirectory on your production server, protect it with .htaccess/.htpasswd (or similar technique, if not Apache), copy the entire application there (most files can be simply symlinked), and enable debug mode on this copy only. Developers and testers can access the “debug” version of the site this way but other visitors can’t.