protected function getMessageFromException($e)
{
// Note: duplicated from FormDatabaseSetup.isAccessDenied
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Piwik database - please check your credentials in config/config.ini.php file";
}
if (Common::isPhpCliMode()) {
return $e->getMessage() . "\n" . $e->getTraceAsString();
}
return $e->getMessage();
}