Commit 4276c78e authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Make sure an error message is available when a database connection failure

is caught.
parent 9f389db3
......@@ -105,7 +105,7 @@ try {
else { // Use single connection
$dbconnected = $db->Connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname);
}
$db->SetFetchMode(ADODB_FETCH_ASSOC);
configure_dbconnection();
ensure_internal_plugins_exist();
......@@ -114,11 +114,10 @@ try {
}
catch (Exception $e) {
$errormessage = ob_get_contents();
if (!$errormessage) {
$errormessage = $e->getMessage();
}
ob_end_clean();
// @todo <nigel|penny>: At this point the raw error message can be munged from
// $errormessage, while the $e object holds some other information (like backtrace,
// which can be parsed with adodb_backtrace($e->gettrace());). At this point a
// nice message should be displayed explaining the problem etc. etc.
throw new Exception($errormessage);
}
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment