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,AWL,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 439B31FB06 for ; Mon, 13 Sep 2021 20:53:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/6] lei_xsearch: sensible errors for missing/broken externals Date: Mon, 13 Sep 2021 20:53:54 +0000 Message-Id: <20210913205355.13002-6-e@80x24.org> In-Reply-To: <20210913205355.13002-1-e@80x24.org> References: <20210913205355.13002-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I've been creating and destroying lots of externals, lately... --- lib/PublicInbox/LeiXSearch.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 9f7f3885..556ffd58 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -572,8 +572,11 @@ sub prepare_external { die "`\\n' not allowed in `$loc'\n" if index($loc, "\n") >= 0; require PublicInbox::Inbox; # v2, v1 $loc = bless { inboxdir => $loc }, 'PublicInbox::Inbox'; + } elsif (!-e $loc) { + warn "W: $loc gone, perhaps run: lei forget-external $loc\n"; + return; } else { - warn "W: ignoring $loc, unable to determine type\n"; + warn "W: $loc ignored, unable to determine external type\n"; return; } push @{$self->{locals}}, $loc;