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 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 E78EA1F4C8 for ; Sat, 16 Nov 2024 07:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1731740994; bh=0rvLeCKztrzswNLhlT6PR8YG3DGo7ql654aASoOzKQM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iprOnzHEXi50wyuqxkQyrHEXP4C4SXNwfrHPUrnZkdv9nKEbVkBSNJWbwgjMqmew2 4khBespbn3pnfMYSdaTD/Y4u0bOYAkcCO/hCr8ymXU7iOZQ8j/lxkgzxiWBwe3gGZk QyVk19EBCaAI1MomuS+iL891muwbn+YpoVrOkNAU= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/6] over: use autodie for open Date: Sat, 16 Nov 2024 07:09:49 +0000 Message-ID: <20241116070953.2945078-3-e@80x24.org> In-Reply-To: <20241116070953.2945078-1-e@80x24.org> References: <20241116070953.2945078-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: autodie improves the consistency of error messages in most places, so we use it here since there's no detail lost. --- lib/PublicInbox/Over.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index 3b7d49f5..f68964c2 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -13,6 +13,7 @@ use PublicInbox::Smsg; use Compress::Zlib qw(uncompress); use constant DEFAULT_LIMIT => 1000; use List::Util (); # for max +use autodie qw(open); sub dbh_new { my ($self, $rw) = @_; @@ -22,7 +23,7 @@ sub dbh_new { require PublicInbox::Syscall; my ($dir) = ($f =~ m!(.+)/[^/]+\z!); PublicInbox::Syscall::nodatacow_dir($dir); - open my $fh, '+>>', $f or die "failed to open $f: $!"; + open my $fh, '+>>', $f; } else { $self->{filename} = $f; # die on stat() below: }