From: Eric Wong Date: Tue, 11 Feb 2025 03:55:34 +0000 (+0000) Subject: search: async_mset: always run callback on exceptions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ecee3d2a058a47a6e16e217a266ecd2a3258e37;p=thirdparty%2Fpublic-inbox.git search: async_mset: always run callback on exceptions To produce consistent error behavior, ensure we always run the user-supplied callback on exceptions when using in-process Xapian (as opposed to the external xap_helper process). --- diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 784e3b0a4..cb1661016 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -493,8 +493,8 @@ sub async_mset { $cb->(@args, undef, $@) if $@; $ret; } else { # synchronous - my $mset = $self->mset($qry_str, $opt); - $cb->(@args, $mset); + my $mset = eval { $self->mset($qry_str, $opt) }; + $@ ? $cb->(@args, undef, $@) : $cb->(@args, $mset); undef; } }