about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-23 21:00:27 +0000
committerEric Wong <e@yhbt.net>2020-08-25 02:47:26 +0000
commit9684e0406fd2c67706bc46e4c8e98a53c8edede3 (patch)
tree78e89eb8f0e1f812bd44c08799f22b557ff056c4 /lib
parent14451d6ce4a27e9fd5f16fa655f6745ca8c87920 (diff)
downloadpublic-inbox-9684e0406fd2c67706bc46e4c8e98a53c8edede3.tar.gz
croak() can give more context on the failure, and setting
`PERL5OPT=-MCarp=verbose' can force a stacktrace.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/SearchIdx.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index ade55756..3f2da6ab 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -137,9 +137,7 @@ sub idx_acquire {
         return unless defined $flag;
         $flag |= $DB_NO_SYNC if $self->{ibx}->{-no_fsync};
         my $xdb = eval { ($X->{WritableDatabase})->new($dir, $flag) };
-        if ($@) {
-                die "Failed opening $dir: ", $@;
-        }
+        croak "Failed opening $dir: $@" if $@;
         $self->{xdb} = $xdb;
 }