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:
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user