How to stop rendering errors being output in production
DB connection errors are the only case where Craft will output the full error even if Dev Mode is disabled, because 99.99% of the time those only occur when Craft is not yet installed, and it’s an extremely common issue people run into when installing Craft.

If you really want to prevent those errors from showing up on the front end, you can edit your index.php file so that it catches them, and displays something different:

&lt;?php

// Path to your craft/ folder
$craftPath = '../craft';

// Do not edit below this line
$path = rtrim($craftPath, '/').'/app/index.php';

if (!is_file($path))
{
    exit('Could not find your craft/ folder. Please ensure that &lt;strong&gt;&lt;code&gt;$craftPath&lt;/code&gt;&lt;/strong&gt; is set correctly in '.__FILE__);
}

try
{
    require_once $path;
}
catch (Craft\DbConnectException $e)
{
    exit('An error occurred.');
}