]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: improve Xapian open failure messages
authorEric Wong <e@80x24.org>
Sun, 8 Aug 2021 20:07:47 +0000 (20:07 +0000)
committerEric Wong <e@80x24.org>
Mon, 9 Aug 2021 06:20:22 +0000 (06:20 +0000)
Displaying $! can help users diagnose resource limit problems
such as EMFILE/ENFILE/ENOMEM.  $@ is currently useful for XS
Search::Xapian and perhaps future versions of the Xapian.pm SWIG
bindings.

lib/PublicInbox/LeiXSearch.pm

index 3414e87dd41ec917021bd017f96efeda1cb39b0a..393f25bf8f3fa182f0c9a27bcf3375c20fb49be5 100644 (file)
@@ -32,7 +32,7 @@ sub attach_external {
        my ($self, $ibxish) = @_; # ibxish = ExtSearch or Inbox
        my $desc = $ibxish->{inboxdir} // $ibxish->{topdir};
        my $srch = $ibxish->search or
-               return warn("$desc not indexed for Xapian\n");
+               return warn("$desc not indexed for Xapian ($@ $!)\n");
        my @shards = $srch->xdb_shards_flat or
                return warn("$desc has no Xapian shards\n");