Missing keyword entries should be non-fatal since Xapian
data is always less important than what's in git and SQLite.
As such, Xapian data has and remains written last, leaving
the possibility of documents being missing from Xapian but
present in SQLite and git.
This improves recovery dealing with badly interrupted or failed
imports due to bugs or hardware failures.
}
if (!defined($cur_kw) && $@) {
$docids = join(', num:', @$docids);
- croak "E: num:$docids keyword lookup failure: $@";
+ # this may happen if a previous import was incomplete since
+ # we commit changes to Xapian last
+ if (ref($@) =~ /::DocNotFoundError\b/) {
+ warn <<EOM;
+W: num:$docids keyword lookup failure, assuming no keywords
+EOM
+ } else {
+ croak "E: num:$docids keyword lookup failure: $@";
+ }
}
# RFC 5550 sec 5.9 on the $Forwarded keyword states:
# "Once set, the flag SHOULD NOT be cleared"