comparison php/read/getBookDetails.php @ 34:5cae8d572998

more error info
author Charlie Root
date Fri, 04 Jan 2019 12:53:10 -0500
parents b058736bc9ad
children e570b199108b
comparison
equal deleted inserted replaced
33:c9d9b76ecbf9 34:5cae8d572998
232 $mm=array(); 232 $mm=array();
233 if (preg_match("/<Error>/",$out,$mm)) { 233 if (preg_match("/<Error>/",$out,$mm)) {
234 $xml = new SimpleXMLElement($out); 234 $xml = new SimpleXMLElement($out);
235 $resName=$xml->getName(); 235 $resName=$xml->getName();
236 $code=$xml->Error->Code; 236 $code=$xml->Error->Code;
237 if (!$code) { 237 if ($code) {
238 $message=$xml->Error->Message;
239 }
240 else {
238 $code=$xml->Items->Request->Errors->Error->Code; 241 $code=$xml->Items->Request->Errors->Error->Code;
242 $message=$xml->Items->Request->Errors->Error->Message;
239 } 243 }
240 $requestIP = $_SERVER['REMOTE_ADDR']; 244 $requestIP = $_SERVER['REMOTE_ADDR'];
241 file_put_contents('/var/ywww/debug/phpDebug',"Losing gBD: ".$mm[0].", $resName, $code, $requestIP\n",FILE_APPEND); 245 file_put_contents('/var/ywww/debug/phpDebug',"Losing gBD: ".$mm[0].", $resName, $code, $requestIP\n",FILE_APPEND);
242 if ($code=='RequestThrottled') { 246 if ($code=='RequestThrottled') {
243 usleep(200000); // Try to reduce throttling until we get a 247 usleep(200000); // Try to reduce throttling until we get a
244 // principled solution in place 248 // principled solution in place
245 } 249 }
246 else { 250 else {
247 file_put_contents('/var/ywww/debug/phpDebug',"parms $url\nbd: ". 251 file_put_contents('/var/ywww/debug/phpDebug',"message: $message\n",FILE_APPEND);
248 print_r($parameters,TRUE)."\n",FILE_APPEND);
249 if ($code=="") { 252 if ($code=="") {
250 file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$out\n",FILE_APPEND); 253 file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$out\n",FILE_APPEND);
251 } 254 }
252 } 255 }
253 } 256 }