From: donal72 Date: Wed, 17 Oct 2007 08:14:47 +0000 (+0000) Subject: Laying groundwork for more Mnet error reporting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fd7756e46878d5f5b674d13590638df3c336624b;p=moodle.git Laying groundwork for more Mnet error reporting --- diff --git a/mnet/xmlrpc/xmlparser.php b/mnet/xmlrpc/xmlparser.php index 066265ff0c..0c9b9b5ed0 100644 --- a/mnet/xmlrpc/xmlparser.php +++ b/mnet/xmlrpc/xmlparser.php @@ -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;