From: Eric Wong Date: Mon, 16 Aug 2021 05:39:33 +0000 (+0000) Subject: lei_search: avoid unconditional warning when no exception X-Git-Tag: v1.7.0~506 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=0a3bcc909a9b023755079ee57f347f33aac75d3e;p=public-inbox.git lei_search: avoid unconditional warning when no exception Oops, we shouldn't warn on "$@" unless "$@" is truthy. Fixes: c7bcfe6cd6648ff0 ("lei: diagnostics for /Document \d+ not found/ errors") --- diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm index f9e5c8e9..47160ed9 100644 --- a/lib/PublicInbox/LeiSearch.pm +++ b/lib/PublicInbox/LeiSearch.pm @@ -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));