comparison xml/getAmazonInfo.php @ 7:1dfe64e365a0

a bit more debugging/bomb-proofing
author Robert Boland <robert@markup.co.uk>
date Fri, 17 Feb 2017 13:40:20 +0000
parents 55445b456ad0
children 232deb0b066a
comparison
equal deleted inserted replaced
6:077b0a0a3e6d 7:1dfe64e365a0
116 if (preg_match("<Error>",$output)) { 116 if (preg_match("<Error>",$output)) {
117 $xml = new SimpleXMLElement($output); 117 $xml = new SimpleXMLElement($output);
118 $resName=$xml->getName(); 118 $resName=$xml->getName();
119 $code=$xml->Error->Code; 119 $code=$xml->Error->Code;
120 file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, ". 120 file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, ".
121 $xml->Error->Code."\n",FILE_APPEND); 121 $code."\n",FILE_APPEND);
122 if ($code=='RequestThrottled') {
123 usleep(200000); // Try to reduce throttling until we get a
124 // principled solution in place
125 }
122 } 126 }
123 else { 127 else {
124 $xml = new SimpleXMLElement($output); 128 $xml = new SimpleXMLElement($output);
125 set_error_handler(function () { 129 set_error_handler(function () {
126 global $output; 130 global $output;