From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 831A31F8C6 for ; Mon, 16 Aug 2021 05:39:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei_search: avoid unconditional warning when no exception Date: Mon, 16 Aug 2021 05:39:33 +0000 Message-Id: <20210816053933.11383-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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));