mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-30147 do not rely on dml exception type outside of dml layer
The trouble is that dml driver methods (insert, update, select) are not guaranteed to return the same exception class for various db problems and coding style issues. The recommended practice is to catch dml_exception only.
This commit is contained in:
parent
c04e80e328
commit
69ac5d478f
5 changed files with 14 additions and 14 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue