Skip to content

Commit

Permalink
Merge branch 'wip-MSFTMPP-426-m30' into MOODLE_30_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcq committed Mar 29, 2016
2 parents d1ab337 + ea150f8 commit e055bb1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions classes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ public static function tostring($val) {
}
} else if (is_null($val)) {
return '(null)';
} else if ($val instanceof \Exception) {
$valinfo = [
'file' => $val->getFile(),
'line' => $val->getLine(),
'message' => $val->getMessage(),
];
if ($val instanceof \moodle_exception) {
$valinfo['debuginfo'] = $val->debuginfo;
$valinfo['errorcode'] = $val->errorcode;
$valinfo['module'] = $val->module;
}
return print_r($valinfo, true);
} else {
return print_r($val, true);
}
Expand Down

0 comments on commit e055bb1

Please sign in to comment.