From 5ba6c440d318a9dbc62acd17c415354e76ac30e5 Mon Sep 17 00:00:00 2001 From: toins Date: Fri, 20 Jul 2007 08:34:58 +0000 Subject: [PATCH] adding an eval to prevent an execption when getting marc biblio --- misc/cronjobs/build_browser_and_cloud.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/misc/cronjobs/build_browser_and_cloud.pl b/misc/cronjobs/build_browser_and_cloud.pl index 490d542fb7..dea5318f2e 100755 --- a/misc/cronjobs/build_browser_and_cloud.pl +++ b/misc/cronjobs/build_browser_and_cloud.pl @@ -54,7 +54,6 @@ warn "browser : $browser_tag / $browser_subfield"; die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag; my $dbh = C4::Context->dbh; -my $starttime = time(); my $i=0; $|=1; # flushes output @@ -78,7 +77,14 @@ while ((my ($biblionumber)= $sth->fetchrow)) { $i++; print "." unless $batch; #now, parse the record, extract the item fields, and store them in somewhere else. - my $Koharecord = GetMarcBiblio($biblionumber); + my $Koharecord; + eval{ + $Koharecord = GetMarcBiblio($biblionumber); + }; + if($@){ + warn 'pb when getting biblio '.$i.' : '.$@; + next; + } # deal with BROWSER part if ($browser_tag) { foreach my $browsed_field ($Koharecord->subfield($browser_tag,$browser_subfield)) { @@ -117,8 +123,8 @@ if ($browser_tag) { } $classification = dewey_french(); # calculate end node... - use Data::Dumper; - warn "==>".Dumper(%browser_result); + #use Data::Dumper; + #warn "==>".Dumper(%browser_result); foreach (keys %browser_result) { my $father = substr($_,0,-1); $browser_result{$father}->{notendnode}=1; @@ -1504,4 +1510,4 @@ return { "999" => "de l'Antarctique", } ; -} \ No newline at end of file +} -- 2.39.5