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

Bug #8182 I retreaved a wrong PEAR::raiseError ?
Submitted: 2006-07-11 11:41 UTC Modified: 2006-12-24 14:07 UTC
From: ono_matope at hotmail dot com Assigned: ttsuruoka
Status: Closed Package: Services_Amazon (version 0.5.0)
PHP Version: 4.4.2 OS: Windows XP SP2
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-11 11:41 UTC] ono_matope at hotmail dot com (ono_matope)
Description: ------------ Hi. I used BrowseNodeLookup or ItemLookup via doBatch, And I retrieved a warning and PHP::raiseError object. I think the _checkContentError always returns PEAR::raiseError object when doBatch is called. If it is a kind of a bug, would you fix it? When I changed a few lines in the code of _checkContentError() like below, It goes fine. ===================== if(0!=count($errors)){ <-- Added $this->_errors = $errors; return PEAR::raiseError(implode(':', $this->getError())); } <-- Added ===================== Test script: --------------- $this->amazon = new Services_AmazonECS4 ([id],[affiliate id]); $this->amazon->setLocale('JP'); $shared = array('ResponseGroup' =>'BrowseNodeInfo'); $params1 = array('BrowseNodeId' => "513256"); $params2 = array('BrowseNodeId' => "513256"); $result = $this->amazon->doBatch('BrowseNodeLookup', $shared, $params1, $params2); print_r ($result); Expected result: ---------------- Array ( [0] => Array ( [Request] => Array ( [IsValid] => True [BrowseNodeLookupRequest] => Array ( [BrowseNodeId] => 507300 [ResponseGroup] => Array ( [0] => BrowseNodeInfo ) ) ) [BrowseNode] => Array ( [BrowseNodeId] => 507300 [Name] => SF・ホラー・ファンタジー [Children] => Array ( [BrowseNode] => Array ( [0] => Array ( [BrowseNodeId] => 507304 [Name] => 日本の著者 ) [1] => Array ( [BrowseNodeId] => 507054 [Name] => 外国の著者 ) ) ) ) ) [1] => Array ( [Request] => Array ( [IsValid] => True [BrowseNodeLookupRequest] => Array ( [BrowseNodeId] => 513256 [ResponseGroup] => Array ( [0] => BrowseNodeInfo ) ) ) [BrowseNode] => Array ( [BrowseNodeId] => 513256 [Name] => 日本の著者 [Children] => Array ( [BrowseNode] => Array ( [0] => Array ( [BrowseNodeId] => 513260 [Name] => あ行 ) [1] => Array ( [BrowseNodeId] => 513262 [Name] => か行 ) [2] => Array ( [BrowseNodeId] => 513264 [Name] => さ行 ) [3] => Array ( [BrowseNodeId] => 513266 [Name] => た行 ) [4] => Array ( [BrowseNodeId] => 513268 [Name] => な行 ) [5] => Array ( [BrowseNodeId] => 513270 [Name] => は行 ) [6] => Array ( [BrowseNodeId] => 513272 [Name] => ま行 ) [7] => Array ( [BrowseNodeId] => 546492 [Name] => や行 ) [8] => Array ( [BrowseNodeId] => 513274 [Name] => ら・わ行 ) ) ) ) ) Actual result: -------------- Warning: implode(): Bad arguments. in C:\Program Files\php\pear\Services\AmazonECS4.php on line 1071 pear_error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => C:\Program Files\php\pear\PEAR.php [line] => 543 [function] => pear_error [class] => pear_error [type] => -> [args] => Array ( [0] => [1] => [2] => 1 [3] => 1024 [4] => ) ) [1] => Array ( [file] => C:\Program Files\php\pear\Services\AmazonECS4.php [line] => 1071 [function] => raiseerror [class] => pear [type] => :: [args] => Array ( [0] => ) ) [2] => Array ( [file] => C:\Program Files\php\pear\Services\AmazonECS4.php [line] => 1040 [function] => _checkcontenterror [class] => services_amazonecs4 [type] => -> [args] => Array ( [0] => Array ( [0] => Array ( [Request] => Array ( [IsValid] => True [BrowseNodeLookupRequest] => Array ( [BrowseNodeId] => 507300 [ResponseGroup] => Array ( [0] => BrowseNodeInfo ) ) ) [BrowseNode] => Array ( [BrowseNodeId] => 507300 [Name] => SF・ホラー・ファンタジー [Children] => Array ( [BrowseNode] => Array ( [0] => Array ( [BrowseNodeId] => 507304 [Name] => 日本の著者 ) [1] => Array ( [BrowseNodeId] => 507054 [Name] => 外国の著者 ) ) ) ) ) [1] => Array ( [Request] => Array ( [IsValid] => True [BrowseNodeLookupRequest] => Array ( [BrowseNodeId] => 513256 [ResponseGroup] => Array ( [0] => BrowseNodeInfo ) ) ) [BrowseNode] => Array ( [BrowseNodeId] => 513256 [Name] => 日本の著者 [Children] => Array ( [BrowseNode] => Array ( [0] => Array ( [BrowseNodeId] => 513260 [Name] => あ行 ) [1] => Array ( [BrowseNodeId] => 513262 [Name] => か行 ) [2] => Array ( [BrowseNodeId] => 513264 [Name] => さ行 ) [3] => Array ( [BrowseNodeId] => 513266 [Name] => た行 ) [4] => Array ( [BrowseNodeId] => 513268 [Name] => な行 ) [5] => Array ( [BrowseNodeId] => 513270 [Name] => は行 ) [6] => Array ( [BrowseNodeId] => 513272 [Name] => ま行 ) [7] => Array ( [BrowseNodeId] => 546492 [Name] => や行 ) [8] => Array ( [BrowseNodeId] => 513274 [Name] => ら・わ行 ) ) ) ) ) ) ) ) [3] => Array ( [file] => C:\Program Files\php\pear\Services\AmazonECS4.php [line] => 857 [function] => _sendrequest [class] => services_amazonecs4 [type] => -> [args] => Array ( [0] => Array ( [Operation] => BrowseNodeLookup [BrowseNodeLookup.Shared.ResponseGroup] => BrowseNodeInfo [BrowseNodeLookup.1.BrowseNodeId] => 507300 [BrowseNodeLookup.2.BrowseNodeId] => 513256 ) ) ) [4] => Array ( [file] => C:\Program Files\Apache Group\Apache2\htdocs\sample\amazon\build_bn_class.php [line] => 19 [function] => dobatch [class] => services_amazonecs4 [type] => -> [args] => Array ( [0] => BrowseNodeLookup [1] => Array ( [ResponseGroup] => BrowseNodeInfo ) [2] => Array ( [BrowseNodeId] => 507300 ) [3] => Array ( [BrowseNodeId] => 513256 ) ) ) [5] => Array ( [file] => C:\Program Files\Apache Group\Apache2\htdocs\sample\amazon\build_bn_class.php [line] => 25 [function] => build_bn [class] => build_bn_class [type] => -> [args] => Array ( [0] => 507300 ) ) ) [callback] => )

Comments

 [2006-08-04 08:59 UTC] ttsuruoka at php dot net (Tatsuya Tsuruoka)
This has been fixed in the latest releasaed version. Thank you for reporting!
 [2006-08-09 01:09 UTC] ono_matope at hotmail dot com
Thank you for your fixing! :)