- my $cur_kw = eval { msg_keywords($self, $docids->[0]) };
- die "E: #$docids->[0] keyword lookup failure: $@\n" if $@;
-
+ for my $id (@$docids) {
+ $cur_kw = eval { msg_keywords($self, $id) } and last;
+ }
+ if (!defined($cur_kw) && $@) {
+ $docids = join(', num:', @$docids);
+ croak "E: num:$docids keyword lookup failure: $@";
+ }