From: toins Date: Fri, 20 Jul 2007 08:34:58 +0000 (+0000) Subject: adding an eval to prevent an execption when getting marc biblio X-Git-Tag: dev_week~39 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=5ba6c440d318a9dbc62acd17c415354e76ac30e5;p=koha_fer adding an eval to prevent an execption when getting marc biblio --- 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 +}