Skip to content

Commit

Permalink
MDL-31552 Change add_to_log() so that it's exception handling throws …
Browse files Browse the repository at this point in the history
…a useful message when there is a problem.
  • Loading branch information
Gerard (Gerry) Caulfield committed Feb 14, 2012
1 parent 5fc420e commit 709dfc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,8 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
try {
$DB->insert_record_raw('log', $log, false);
} catch (dml_exception $e) {
debugging('Error: Could not insert a new entry to the Moodle log', DEBUG_ALL);
debugging('Error: Could not insert a new entry to the Moodle log. '. $e->error, DEBUG_ALL);

// MDL-11893, alert $CFG->supportemail if insert into log failed
if ($CFG->supportemail and empty($CFG->noemailever)) {
// email_to_user is not usable because email_to_user tries to write to the logs table,
Expand Down

0 comments on commit 709dfc0

Please sign in to comment.