From c8cc6716032a924a3cfb8f27855da7fd1dc65aeb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Nov 2024 07:09:49 +0000 Subject: [PATCH] over: use autodie for open 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 3b7d49f52..f68964c27 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: } -- 2.47.3