]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15352: add error management to mnet communication
authorjerome <jerome>
Mon, 27 Oct 2008 05:12:32 +0000 (05:12 +0000)
committerjerome <jerome>
Mon, 27 Oct 2008 05:12:32 +0000 (05:12 +0000)
lang/en_utf8/repository_remotemoodle.php
repository/remotemoodle/repository.class.php

index 4471b2ec689970652ff29f5376fe28eaf547216f..4fd58aa621d12be0b24fd8633194e4bc39ecbbbe 100644 (file)
@@ -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';
\ No newline at end of file
+$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
+$string['usernotfound'] = 'The user $a is not registered into the remote Moodle';
\ No newline at end of file
index 38992bd18fb6f9c1b484d3af66a332d5b1b0bba6..bfcdcae1dd9c7ad2d8b751a6b15559afc340c71e 100644 (file)
@@ -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;