]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
over: use autodie for open
authorEric Wong <e@80x24.org>
Sat, 16 Nov 2024 07:09:49 +0000 (07:09 +0000)
committerEric Wong <e@80x24.org>
Sun, 17 Nov 2024 18:54:10 +0000 (18:54 +0000)
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

index 3b7d49f52677bf4d01b64d9aea280be6d9e665a2..f68964c270be0f0bf0f0ac6b6599168e733f17bc 100644 (file)
@@ -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:
                }