Permalink
Browse files

Laying groundwork for more Mnet error reporting

  • Loading branch information...
1 parent d029c12 commit b3225d1a2ffab332e7e39fbf33bdcc01421b015d donal72 committed Oct 17, 2007
Showing with 8 additions and 0 deletions.
  1. +8 −0 mnet/xmlrpc/xmlparser.php
@@ -42,6 +42,7 @@ function initialise() {
$this->key_URI = '';
$this->payload_encrypted = false;
$this->cipher = array();
+ $this->error = array();
return true;
}
@@ -89,6 +90,13 @@ function parse($data) {
$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;

0 comments on commit b3225d1

Please sign in to comment.