mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 00:20:37 +01:00
Merge branch 'MDL-64961-master' of https://github.com/sammarshallou/moodle
This commit is contained in:
commit
9aae08ac91
@ -150,7 +150,9 @@ class webservice_rest_server extends webservice_base_server {
|
||||
if ($this->restformat == 'json') {
|
||||
$errorobject = new stdClass;
|
||||
$errorobject->exception = get_class($ex);
|
||||
$errorobject->errorcode = $ex->errorcode;
|
||||
if (isset($ex->errorcode)) {
|
||||
$errorobject->errorcode = $ex->errorcode;
|
||||
}
|
||||
$errorobject->message = $ex->getMessage();
|
||||
if (debugging() and isset($ex->debuginfo)) {
|
||||
$errorobject->debuginfo = $ex->debuginfo;
|
||||
@ -159,8 +161,10 @@ class webservice_rest_server extends webservice_base_server {
|
||||
} else {
|
||||
$error = '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
|
||||
$error .= '<EXCEPTION class="'.get_class($ex).'">'."\n";
|
||||
$error .= '<ERRORCODE>' . htmlspecialchars($ex->errorcode, ENT_COMPAT, 'UTF-8')
|
||||
. '</ERRORCODE>' . "\n";
|
||||
if (isset($ex->errorcode)) {
|
||||
$error .= '<ERRORCODE>' . htmlspecialchars($ex->errorcode, ENT_COMPAT, 'UTF-8')
|
||||
. '</ERRORCODE>' . "\n";
|
||||
}
|
||||
$error .= '<MESSAGE>'.htmlspecialchars($ex->getMessage(), ENT_COMPAT, 'UTF-8').'</MESSAGE>'."\n";
|
||||
if (debugging() and isset($ex->debuginfo)) {
|
||||
$error .= '<DEBUGINFO>'.htmlspecialchars($ex->debuginfo, ENT_COMPAT, 'UTF-8').'</DEBUGINFO>'."\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user