]> git.mjollnir.org Git - moodle.git/commitdiff
Laying groundwork for more Mnet error reporting
authordonal72 <donal72>
Wed, 17 Oct 2007 08:14:47 +0000 (08:14 +0000)
committerdonal72 <donal72>
Wed, 17 Oct 2007 08:14:47 +0000 (08:14 +0000)
mnet/xmlrpc/xmlparser.php

index 066265ff0cbc7b5f621c11416ac7e3cf1f641791..0c9b9b5ed02279326609d71631f4cb03e256a2ae 100644 (file)
@@ -42,6 +42,7 @@ class mnet_encxml_parser {
         $this->key_URI           = '';
         $this->payload_encrypted = false;
         $this->cipher            = array();
+        $this->error             = array();
         return true;
     }
 
@@ -89,6 +90,13 @@ class mnet_encxml_parser {
 
         $p = xml_parse($this->parser, $data);
 
+        if ($p == 0) {
+            // Parse failed
+            $errcode = xml_get_error_code($this->parser);
+            $errstring = xml_error_string($errcode);
+            $this->error[] = array('code' => $errcode, 'string' => $errstring);
+        }
+
         if (count($this->cipher) > 0) {
             $this->cipher = array_values($this->cipher);
             $this->payload_encrypted = true;