]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
searchidx: use warn for excessively long terms
authorEric Wong <e@80x24.org>
Sat, 13 Sep 2025 12:21:50 +0000 (12:21 +0000)
committerEric Wong <e@80x24.org>
Sat, 13 Sep 2025 19:26:30 +0000 (19:26 +0000)
Filename and linenumber context information from Carp::carp is
unlikely to be useful here on (likely) worthless data from bad
MUAs.  carp adds needless noise for users tracking down actual
code bugs with PERL5OPT=-MCarp=verbose, which changes Carp::carp
into Carp::cluck.

lib/PublicInbox/SearchIdx.pm

index 0cd7a046b90117070728e765652b65ed94d2fc29..48173a2325ee59ba209bc9b7feb8c0e9724d3dbd 100644 (file)
@@ -200,7 +200,7 @@ sub index_text1 { # called by various ->index_extra
 sub add_bool_term ($$) {
        my ($doc, $pfx_term) = @_;
        if (length($pfx_term) > MAX_TERM_SIZE) {
-               carp "W: skipping term: `$pfx_term'.length > ",
+               warn "W: skipping term: `$pfx_term'.length > ",
                        MAX_TERM_SIZE, "\n";
        } else {
                $doc->add_boolean_term($pfx_term);