diff options
author | Eric Wong <e@80x24.org> | 2023-09-15 22:47:00 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-09-16 12:12:47 +0000 |
commit | 584d2d5fc4fb458792aef93c9802126d0722dfb1 (patch) | |
tree | 661c363861db2b7eb219d580276620435cf6500f /lib/PublicInbox/LeiXSearch.pm | |
parent | 4dcb50319432011d13f8134d37db0a395bfedc68 (diff) | |
download | public-inbox-584d2d5fc4fb458792aef93c9802126d0722dfb1.tar.gz |
Xapian can't parse every query, so ensure we set the exit code for the client.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r-- | lib/PublicInbox/LeiXSearch.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 5965274c..7f4911b3 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -186,7 +186,8 @@ sub query_one_mset { # for --threads and l2m w/o sort } my $first_ids; do { - $mset = $srch->mset($mo->{qstr}, $mo); + $mset = eval { $srch->mset($mo->{qstr}, $mo) }; + return $lei->child_error(22 << 8, "E: $@") if $@; # 22 from curl mset_progress($lei, $dir, $mo->{offset} + $mset->size, $mset->get_matches_estimated); wait_startq($lei); # wait for keyword updates @@ -249,7 +250,8 @@ sub query_combined_mset { # non-parallel for non-"--threads" users } my $each_smsg = $lei->{ovv}->ovv_each_smsg_cb($lei); do { - $mset = $self->mset($mo->{qstr}, $mo); + $mset = eval { $self->mset($mo->{qstr}, $mo) }; + return $lei->child_error(22 << 8, "E: $@") if $@; # 22 from curl mset_progress($lei, 'xsearch', $mo->{offset} + $mset->size, $mset->get_matches_estimated); wait_startq($lei); # wait for keyword updates |