eval() on getAuthority & getBiblio to avoid a script failure

This commit is contained in:
tipaul 2007-08-01 09:20:03 +00:00
parent ae706f0d7a
commit 1399945a75

View file

@ -290,7 +290,15 @@ rank:rank-1
$sth->execute();
my $i=0;
while (my ($authid) = $sth->fetchrow) {
my $record = GetAuthority($authid);
my $record;
eval {
$record = GetAuthority($authid);
};
if($@){
print " There was some pb getting authority : ".$authid."\n";
next;
}
print ".";
print "\r$i" unless ($i++ %100);
# remove leader length, that could be wrong, it will be calculated automatically by as_usmarc
@ -481,11 +489,18 @@ rank:rank-1
open(OUT,">:utf8 ","$directory/biblios/export") or die $!;
my $dbh=C4::Context->dbh;
my $sth;
$sth=$dbh->prepare("select biblionumber from biblioitems where biblionumber >54000 order by biblionumber $limit");
$sth=$dbh->prepare("select biblionumber from biblioitems order by biblionumber $limit");
$sth->execute();
my $i=0;
while (my ($biblionumber) = $sth->fetchrow) {
my $record = GetMarcBiblio($biblionumber);
my $record;
eval {
$record = GetMarcBiblio($biblionumber);
};
if($@){
print " There was some pb getting biblio : #".$biblionumber."\n";
next;
}
# warn $record->as_formatted;
# die if $record->subfield('090','9') eq 11;
# print $record;