mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-15352: add error management to mnet communication
This commit is contained in:
parent
4b31ac5cd1
commit
a1c9c2bdc3
@ -9,4 +9,5 @@ $string['emptyfilelist'] = 'There are no files to show';
|
||||
$string['remoterep_name'] = 'Remote Moodle Repository';
|
||||
$string['remoterep_description'] = 'Allow the service to be discovered<br><br>';
|
||||
$string['connectionfailure'] = 'Failed to retrieve file listing - The host moodle has either a version older than 2.0, either its Moodle Remote Repository service hasn\'t been activated';
|
||||
$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
|
||||
$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
|
||||
$string['usernotfound'] = 'The user $a is not registered into the remote Moodle';
|
@ -273,7 +273,14 @@ class repository_remotemoodle extends repository {
|
||||
$client->add_param($USER->username);
|
||||
$client->add_param($search);
|
||||
|
||||
$client->send($mnet_peer);
|
||||
if (!$client->send($mnet_peer)) {
|
||||
$message =" ";
|
||||
foreach ($client->error as $errormessage) {
|
||||
$message .= "ERROR: $errormessage . ";
|
||||
}
|
||||
echo json_encode(array('e'=>$message));
|
||||
exit;
|
||||
}
|
||||
|
||||
$services = $client->response;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user