]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_search: avoid unconditional warning when no exception
authorEric Wong <e@80x24.org>
Mon, 16 Aug 2021 05:39:33 +0000 (05:39 +0000)
committerEric Wong <e@80x24.org>
Mon, 16 Aug 2021 07:11:04 +0000 (07:11 +0000)
Oops, we shouldn't warn on "$@" unless "$@" is truthy.

Fixes: c7bcfe6cd6648ff0 ("lei: diagnostics for /Document \d+ not found/ errors")
lib/PublicInbox/LeiSearch.pm

index f9e5c8e9846ca4ab7c9626f31d77b9fd97dda176..47160ed98b7a81a4988cd9187fb8afd55a177217 100644 (file)
@@ -64,7 +64,8 @@ sub _xsmsg_vmd { # retry_reopen
                                %L = (%L, %$x);
                        }
                };
-               warn "$$ $0 #$num (nshard=$self->{nshard}) $smsg->{blob}: $@";
+               warn "$$ $0 #$num (nshard=$self->{nshard}) $smsg->{blob}: $@"
+                       if $@;
        }
        $smsg->{kw} = [ sort keys %kw ] if scalar(keys(%kw));
        $smsg->{L} = [ sort keys %L ] if scalar(keys(%L));