I am running a simple perl script in a loop as a work around for the 10
results limit. The script has been tested and is working fine. But the
problem is, I started getting the 502 Bad Gateway Error lately and this
is causing the program to terminate ruining my searching.
Is there anyway I can handle this error, and resume the program if it
occurs? Any suggestions are highly appreciated.
Thanks
a couple of others were having the same problem see
http://groups.google.com/group/google.public.web-apis/browse_thread/thread/bcbaf3a22db42126/9c1929441a8667bc#9c1929441a8667bc
my api errors seem to have vanished today. are you still having issues?
Thanks for the link. I have already seen it. I am still facing the same
problem, and it seems something related to stability of service. Its
still Beta you know.
Anyhow, I rewrote the script using Java and am able to handle the error
now. Its still occuring, but at least the program moves on.
thanks
$receivedError = 0;
$maxErrorsAllowed = 15;
do {
eval {
$googleResults =
$soap->doGoogleSearch($googlekey, $query,
(10*$loopCount), 10,
"true", "", "false", "",
"latin1", "latin1"
);
};
if ( $@ ) {
$receivedError++;
sleep(15);
} else {
$receivedError = 0;
}
} while ( $receivedError && ($receivedError <= $maxErrorsAllowed) );
This will capture any Google error, sleep for 15 seconds, and then
retry up to 15 times. It has been working great for me. Hope this
helps.
Roger
(10*$loopCount), 10, "true",
Roger
Appreciate it.
Bashar