mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Propagate additional error info about XML parse failures
This commit is contained in:
parent
d60a9e40fa
commit
1adbae673c
1 changed files with 16 additions and 1 deletions
|
@ -248,8 +248,23 @@ class mnet_xmlrpc_client {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (! empty($crypt_parser->error)) {
|
||||||
|
$crypt_parser_error = $crypt_parser->error[0];
|
||||||
|
|
||||||
|
$message = '3:XML Parse error in payload: '.$crypt_parser_error['string']."\n";
|
||||||
|
if (array_key_exists('lineno', $crypt_parser_error)) {
|
||||||
|
$message .= 'At line number: '.$crypt_parser_error['lineno']."\n";
|
||||||
|
}
|
||||||
|
if (array_key_exists('line', $crypt_parser_error)) {
|
||||||
|
$message .= 'Which reads: '.$crypt_parser_error['line']."\n";
|
||||||
|
}
|
||||||
|
$this->error[] = $message;
|
||||||
} else {
|
} else {
|
||||||
$this->error[] = '1:Payload not encrypted ';
|
$this->error[] = '1:Payload not encrypted ';
|
||||||
|
}
|
||||||
|
|
||||||
$crypt_parser->free_resource();
|
$crypt_parser->free_resource();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue