From 633451284811284b6208710f1a9371feaba3b4c7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Jul 2022 09:02:29 +0200 Subject: [PATCH] Bug 29697: Don't crash ES reindex if a record is wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't want rebuild_elasticsearch.pl to crash if a record is wrong (also fix ktd setup). Note that now the script will output an error for the problematic record, which is certainly the expected behaviour as we are doing it already for authority records. Signed-off-by: Joonas Kylmälä --- Koha/BiblioUtils.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/BiblioUtils.pm b/Koha/BiblioUtils.pm index ebae899dc6..cb7baed0db 100644 --- a/Koha/BiblioUtils.pm +++ b/Koha/BiblioUtils.pm @@ -145,12 +145,12 @@ sub get_all_biblios_iterator { while (1) { my $row = $rs->next(); return if !$row; - my $marc = $row->metadata->record({ embed_items => 1 }); my $next = eval { + my $marc = $row->metadata->record({ embed_items => 1 }); $class->new($marc, $row->biblionumber); }; if ($@) { - warn "Something went wrong reading record for biblio $row->biblionumber: $@\n"; + warn sprintf "Something went wrong reading record for biblio %s: %s\n", $row->biblionumber, $@; next; } return $next; -- 2.30.2