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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 DF2E51F601 for ; Wed, 17 Aug 2022 09:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1660728797; bh=D3522UKvml8LGDxdEKukxRedFXw62LdpXFxd8+Cy0Ws=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yFx8WrbU1fd46GpQipUIOjEiObMEeRCvzADnOmBZdKp1vylMmWKRfhQw8HrYce1xT fNz/c7LSpVO5M7Dw6//7bL7zt/RWtqNJUt/Gg8Ja65yQnZURD00E+26Wn9/+ggbRsL 3jy9pbn0nuzA5q3z4uyHu9iydCtxHhqE8ZQadeXs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] lei inspect: less scary exception for invalid "docid:" inspect Date: Wed, 17 Aug 2022 09:33:15 +0000 Message-Id: <20220817093317.3820774-3-e@80x24.org> In-Reply-To: <20220817093317.3820774-1-e@80x24.org> References: <20220817093317.3820774-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It still says "Exception:", but doesn't pointlessly print out the line number and file of the exception when it's a data/input problem, and not a code problem on our end. --- lib/PublicInbox/LeiInspect.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiInspect.pm b/lib/PublicInbox/LeiInspect.pm index d7775d4b..d1dca4ef 100644 --- a/lib/PublicInbox/LeiInspect.pm +++ b/lib/PublicInbox/LeiInspect.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # "lei inspect" general purpose inspector for stuff in SQLite and @@ -235,7 +235,8 @@ sub inspect_argv { # via wq_do $lei->{1}->autoflush(0); $lei->out('[') if $multi; while (defined(my $x = shift @$argv)) { - inspect1($lei, $x, scalar(@$argv)) or return; + eval { inspect1($lei, $x, scalar(@$argv)) or return }; + warn "E: $@\n" if $@; } $lei->out(']') if $multi; }