From 0a3bcc909a9b023755079ee57f347f33aac75d3e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 16 Aug 2021 05:39:33 +0000 Subject: 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") --- lib/PublicInbox/LeiSearch.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiSearch.pm') 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)); -- cgit v1.2.3-24-ge0c7