Net::Google error handling

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi there,

Do any of you know how to catch any error from Net::Google (or
underlying SOAP::Lite?). I created a basic script to retrieve files
from Google, and if my internet connexion gets down, I can't catch
neither an exception nor an error code. It just seems to output some
debugging informations...

my $google = Net::Google->new(key=>$key);
my $search = $google->search();

$results = $search->results(); # that method returns an ARRAY in any

Thanks in advance,

Marc-Olivier BERNARD

Re: Net::Google error handling

My poorman solution is to catch and analyse the warnings:

$SIG = sub {
my $message = join('',@_);
  if ($message =~ m/500 Can't connect to{
    # log message and wait to retry
    sleep 180;

Site Timeline