1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

Proper connection exception handling in the DB functional tests.

This commit is contained in:
stronk7 2009-09-02 16:24:43 +00:00
parent 250a5c4998
commit c51ca8350e

@ -54,13 +54,16 @@ for ($i=1; $i<=10; $i++) {
}
$dbinfos[$i]['installed'] = true;
if ($d->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions)) {
try {
$d->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);
$dbinfos[$i]['configured'] = true;
if (data_submitted() and !empty($selected[$i])) {
$tests[$i] = $d;
} else {
$d->dispose();
}
} catch (dml_connection_exception $e) {
$dbinfos[$i]['configured'] = false;
}
}