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

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);
......@@ -114,11 +114,10 @@ try {
catch (Exception $e) {
$errormessage = ob_get_contents();
if (!$errormessage) {
$errormessage = $e->getMessage();
// @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 {
Supports Markdown
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