diff options
author | Eric Wong <e@80x24.org> | 2023-10-08 20:19:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-08 23:45:30 +0000 |
commit | ca3cb3ffb1876342650640495d0e5b757d1662eb (patch) | |
tree | 63834ac9c99c41de45745a784f806eb279065472 /lib/PublicInbox/OverIdx.pm | |
parent | 416855c5f77dbfcd98511ebca9c2171f2509284b (diff) | |
download | public-inbox-ca3cb3ffb1876342650640495d0e5b757d1662eb.tar.gz |
Unlike `die', `croak' can be expanded to `confess' to give a full backtrace. We'll use `confess' on transaction failures since that occasionally causes sporadic t/imapd.t failures on FreeBSD (IO::Kqueue is installed, so signals are deferred).
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r-- | lib/PublicInbox/OverIdx.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index 5cea3706..aead375a 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -199,7 +199,7 @@ sub resolve_mid_to_tid { $tid // do { # create a new ghost my $id = mid2id($self, $mid); my $num = next_ghost_num($self); - $num < 0 or die "ghost num is non-negative: $num\n"; + $num < 0 or croak "BUG: ghost num is non-negative: $num\n"; $tid = next_tid($self); my $dbh = $self->{dbh}; $dbh->prepare_cached(<<'')->execute($num, $tid); @@ -283,7 +283,7 @@ sub _add_over { my ($self, $smsg, $mid, $refs, $old_tid, $v) = @_; my $cur_tid = $smsg->{tid}; my $n = $smsg->{num}; - die "num must not be zero for $mid" if !$n; + croak "BUG: num must not be zero for $mid" if !$n; my $cur_valid = $cur_tid > $self->{min_tid}; if ($n > 0) { # regular mail @@ -454,7 +454,7 @@ sub rollback_lazy { sub dbh_close { my ($self) = @_; - die "in transaction" if $self->{txn}; + Carp::confess('BUG: in transaction') if $self->{txn}; $self->SUPER::dbh_close; } |