From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,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.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7B7D31F51B for ; Wed, 14 Aug 2024 00:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1723594606; bh=jsZh7gL/242CpxP5yTxIgflEnIXzqM4CXwLxgvSaHgc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e/P1CkERYn8dV35JUF6qZyTErKu2l5VjRVBoyK0zC4t6esoj4QV26Wz+eZin9k1hW BlaOH4cHvh4iWmKT6F8FsyKC4wZ+zZG0fnuTKKsXN3NuMqIDmQgFJatB5y/UOClyFX XjOPs+gJZaHhdCARhDovItl87KDTJeJ9eq3KgTdY= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/5] net_reader: improve IMAP error reporting Date: Wed, 14 Aug 2024 00:16:45 +0000 Message-Id: <20240814001645.395576-6-e@80x24.org> In-Reply-To: <20240814001645.395576-1-e@80x24.org> References: <20240814001645.395576-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: IMAPClient->LastError provides information that isn't an errno (`$!'), so use it to tell us about anything the server reports back. --- lib/PublicInbox/NetReader.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index ec18818b..7e861f5f 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -570,7 +570,8 @@ sub each_old_flags ($$$$) { my $r = $mic->fetch_hash("$n:$end", 'FLAGS'); if (!$r) { return if $!{EINTR} && $self->{quit}; - return "E: $uri UID FETCH $n:$end error: $!"; + return "E: $uri UID FETCH $n:$end error: " . + $mic->LastError." \$!=$!" } while (my ($uid, $per_uid) = each %$r) { my $kw = flags2kw($self, $uri, $uid, $per_uid->{FLAGS}) @@ -699,7 +700,8 @@ EOF $uids = [ $single_uid ]; } elsif (!($uids = $mic->search("UID $l_uid:*"))) { return if $!{EINTR} && $self->{quit}; - return "E: $uri UID SEARCH $l_uid:* error: $!"; + return "E: $uri UID SEARCH $l_uid:* error: ". + $mic->LastError." \$!=$!" } return if scalar(@$uids) == 0;