From: Eric Wong Date: Sat, 16 Nov 2024 07:09:49 +0000 (+0000) Subject: over: use autodie for open X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8cc6716032a924a3cfb8f27855da7fd1dc65aeb;p=thirdparty%2Fpublic-inbox.git 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. --- 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: }