mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
Merge branch 'MDL-64961-m35' of https://github.com/sammarshallou/moodle into MOODLE_35_STABLE
This commit is contained in:
commit
e225d71259
1 changed files with 7 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue