diff --git a/lib/datalib.php b/lib/datalib.php index 285729c23c3..88066531899 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1710,7 +1710,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user try { $DB->insert_record_raw('log', $log, false); - } catch (dml_write_exception $e) { + } catch (dml_exception $e) { debugging('Error: Could not insert a new entry to the Moodle log', DEBUG_ALL); // MDL-11893, alert $CFG->supportemail if insert into log failed if ($CFG->supportemail and empty($CFG->noemailever)) { diff --git a/lib/ddl/simpletest/testddl.php b/lib/ddl/simpletest/testddl.php index 7ea1275bbd4..a9377534fc9 100644 --- a/lib/ddl/simpletest/testddl.php +++ b/lib/ddl/simpletest/testddl.php @@ -180,7 +180,7 @@ class ddl_test extends UnitTestCase { ob_start(); // hide debug warning try { $result = $DB->get_records('test_table0'); - } catch (dml_read_exception $e) { + } catch (dml_exception $e) { $result = false; } ob_end_clean(); @@ -203,7 +203,7 @@ class ddl_test extends UnitTestCase { ob_start(); // hide debug warning try { $result = $DB->get_records('test_table0'); - } catch (dml_read_exception $e) { + } catch (dml_exception $e) { $result = false; } ob_end_clean(); @@ -337,14 +337,14 @@ class ddl_test extends UnitTestCase { try { // columns cache must be empty, so sentence throw exception $columns = $DB->get_columns('test_table0'); - } catch (dml_read_exception $e) { + } catch (dml_exception $e) { $columns = false; } $this->assertFalse($columns); try { /// throw exception $indexes = $DB->get_indexes('test_table0'); - } catch (dml_read_exception $e) { + } catch (dml_exception $e) { $indexes = false; } $this->assertFalse($indexes); @@ -931,7 +931,7 @@ class ddl_test extends UnitTestCase { ob_start(); // hide debug warning try { $result = $DB->insert_record('test_table_cust0', $record, false); - } catch (dml_write_exception $e) { + } catch (dml_exception $e) { $result = false; } ob_end_clean(); @@ -953,7 +953,7 @@ class ddl_test extends UnitTestCase { ob_start(); // hide debug warning try { $result = $DB->insert_record('test_table_cust0', $record, false); - } catch (dml_write_exception $e) { + } catch (dml_exception $e) { $result = false; } ob_end_clean(); @@ -1022,7 +1022,7 @@ class ddl_test extends UnitTestCase { ob_start(); // hide debug warning try { $result = $DB->insert_record('test_table_cust0', $record, false); - } catch (dml_write_exception $e) { + } catch (dml_exception $e) { $result = false;; } ob_end_clean(); @@ -1644,7 +1644,7 @@ class ddl_test extends UnitTestCase { $rec = $DB->get_record($tablename, array('id'=>$id)); $this->assertIdentical($rec->name, $maxstr); - } catch (dml_write_exception $e) { + } catch (dml_exception $e) { if ($DB->get_dbfamily() === 'oracle') { $this->fail('Oracle does not support text fields larger than 4000 bytes, this is not a big problem for mostly ascii based languages'); } else { diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index 627c6c14638..802b68f9223 100644 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -905,7 +905,7 @@ class dml_test extends UnitTestCase { $DB->execute($sql); $this->fail("Expecting an exception, none occurred"); } catch (Exception $e) { - $this->assertTrue($e instanceof dml_write_exception); + $this->assertTrue($e instanceof dml_exception); } // update records @@ -1785,7 +1785,7 @@ class dml_test extends UnitTestCase { try { $DB->insert_record_raw($tablename, array('xxxxx' => 3, 'onechar' => 'bb')); $this->assertFail('Exception expected due to invalid column'); - } catch (dml_write_exception $ex) { + } catch (dml_exception $ex) { $this->assertTrue(true); } } diff --git a/lib/dmllib.php b/lib/dmllib.php index 19546aec986..2e5945463b5 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -91,7 +91,7 @@ class dml_sessionwait_exception extends dml_exception { } /** - * DML read exception - triggered by SQL syntax errors, missing tables, etc. + * DML read exception - triggered by some SQL syntax errors, etc. */ class dml_read_exception extends dml_exception { /** @var string */ @@ -185,7 +185,7 @@ class dml_missing_record_exception extends dml_exception { } /** - * DML write exception - triggered by SQL syntax errors, missing tables, etc. + * DML write exception - triggered by some SQL syntax errors, etc. */ class dml_write_exception extends dml_exception { /** @var string */ diff --git a/lib/setuplib.php b/lib/setuplib.php index bdb287d50dd..205cd3229e7 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -657,7 +657,7 @@ function initialise_cfg() { $CFG->{$name} = $value; } } - } catch (dml_read_exception $e) { + } catch (dml_exception $e) { // most probably empty db, going to install soon } }