Re: XML_Serilaizer - Problem with PEAR::setErrorHandling
| From: | Lukas Smith | Date: | Thu, 25 Nov 2004 13:19:33 +0000 |
| Subject: | Re: XML_Serilaizer - Problem with PEAR::setErrorHandling | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15811@lists.php.net to get a copy of this message | ||
Georg Bez wrote:
Hi, i use the function to intercept PEAR::setErrorHandling around appearing mistakes and to evaluate. This leads by the using XML_Serilaizer to problems. If i give the Serilaizer a multi one dimensional array hand over my program is broken off by a an "error" while testing, within the class XML_Serilaizer, with the function XML_Util::isValidName. Would it be better to produce on these places no error object? Is this a problem on mine or on the side of the class?I have already send stefan a patch for this. Essentially what is missing are expectError()/popExpect() calls around the method call. RCS file: /repository/pear/XML_Serializer/Serializer.php,v retrieving revision 1.26 diff -u -r1.26 Serializer.php --- Serializer.php 6 Nov 2004 15:49:52 -0000 1.26 +++ Serializer.php 25 Nov 2004 13:19:20 -0000 @@ -430,7 +430,9 @@
// copy key
$origKey = $key;
// key cannot be used as tagname => use default tag
+ $this->expectError(array(.. lots of error codes that XML_Util::isValidName may throw));
$valid = XML_Util::isValidName($key);
+ $this->popExpect();
if (PEAR::isError($valid)) {
if ($this->options['classAsTagName'] && is_object($value)) {
$key = get_class($value);
regards,
Lukas