Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.0

Bug #7235 Deserialize error not caught
Submitted: 2006-03-29 07:40 UTC
From: jbruyndonckx at telenet dot be Assigned: ttsuruoka
Status: Closed Package: Services_Amazon (version 0.4.0)
PHP Version: 5.1.2 OS: Windows XP
Roadmaps: (Not assigned)    

 [2006-03-29 07:40 UTC] jbruyndonckx at telenet dot be (Jan Bruyndonckx)
Description: ------------ Hi, When an error occurs during deserialisation, then the getUnserializedData() is empty. The real error can be retrieved by looking at the return value of $xml->unserialize(). Also, then return value of this last function should be checked against being a PEAER_Error. This code snipped at line 935 in AmazonECS4.php fixed the problem. $result = $http->getResponseBody(); $xml = &new XML_Unserializer(array('parseAttributes' => true)); $data = $xml->unserialize($result, false); if (PEAR::isError ($data)) { return $data ; } $data = $xml->getUnserializedData(); if (PEAR::isError ($data)) { return $data ; } if (isset($data['Error'])) { $errormsg = $data['Error']['Code'] . ': ' . $data['Error']['Message']; return PEAR::raiseError($errormsg); }


 [2006-05-20 10:28 UTC] ttsuruoka at php dot net (Tatsuya Tsuruoka)
This has been fixed in 0.5.0. Thank you for reporting!