unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/6] over: use autodie for open
Date: Sat, 16 Nov 2024 07:09:49 +0000	[thread overview]
Message-ID: <20241116070953.2945078-3-e@80x24.org> (raw)
In-Reply-To: <20241116070953.2945078-1-e@80x24.org>

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:
 		}

  parent reply	other threads:[~2024-11-16  7:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16  7:09 [PATCH 0/6] v5.12 + autodie cleanups Eric Wong
2024-11-16  7:09 ` [PATCH 1/6] index: use v5.12, remove outdated comment Eric Wong
2024-11-16  7:09 ` Eric Wong [this message]
2024-11-16  7:09 ` [PATCH 3/6] lei_blob: use autodie for open + seek Eric Wong
2024-11-16  7:09 ` [PATCH 4/6] admin: autodie chdir + open Eric Wong
2024-11-16  7:09 ` [PATCH 5/6] xapcmd: use autodie for numerous syscalls Eric Wong
2024-11-16  7:09 ` [PATCH 6/6] spamc: autodie for open + sysseek Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241116070953.2945078-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).