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 5EF841F518 for ; Fri, 8 Mar 2024 21:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1709931905; bh=NmH7k1YIaPncwUXxCN2haX9BjDh0y+lT8MFmpxQ3zhU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SqqQmRPv2cRVqAMl03+/1HViQt7+Sp17mXxRn6DJDjNJ9ViduUuKynKsYp0GNV+/X julcFKZZa67hUT3oceqW+g3dbe1v14L4aJ+wMun148yJBG2S9MY6lTxxrzKSTLLDCJ ec7g5MCiHkg8KK8aMM5WNJB1rXaX9nlgI2H6WDN8= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] import: croak (instead of die) on write failures Date: Fri, 8 Mar 2024 21:05:04 +0000 Message-ID: <20240308210504.905620-3-e@80x24.org> In-Reply-To: <20240308210504.905620-1-e@80x24.org> References: <20240308210504.905620-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This allows accurate reporting of the error location and can be made to dump a Perl backtrace via PERL5OPT='-MCarp=verbose'. Noticed while tracking down fast-import failures. Link: https://public-inbox.org/meta/CAL_JsqK7P4gjLPyvzxNEcYmxT4j6Ah5f3Pz1RqDHxmysTg3aEg@mail.gmail.com/ --- lib/PublicInbox/Import.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 51ddfa7f..a951874b 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -85,7 +85,7 @@ sub gfi_start { $self->{io}; } -sub wfail () { die "write to fast-import failed: $!" } +sub wfail () { croak "write to fast-import failed: $!" } sub now_raw () { time . ' +0000' }