[Rt-commit] rt branch, 4.0/fix-indexer-error-handling, created. rt-4.0.10-89-g923d983
Emannuel Lacour
elacour at bestpractical.com
Thu Mar 14 10:46:22 EDT 2013
The branch, 4.0/fix-indexer-error-handling has been created
at 923d9834f7645b9c8a18f49fc3602ac11b24d662 (commit)
- Log -----------------------------------------------------------------
commit 923d9834f7645b9c8a18f49fc3602ac11b24d662
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date: Thu Mar 14 15:44:15 2013 +0100
Use PG err code instead of errstr as the latest may not work in non english environment
diff --git a/sbin/rt-fulltext-indexer.in b/sbin/rt-fulltext-indexer.in
index b86a814..9ad6d26 100644
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@ -374,9 +374,9 @@ sub process_pg {
my $status = eval { $dbh->do( $query, undef, $$text, $attachment->id ) };
unless ( $status ) {
- if ($dbh->errstr =~ /string is too long for tsvector/) {
+ if ( $dbh->err == 7 && $dbh->state eq '54000' ) {
warn "Attachment @{[$attachment->id]} cannot be indexed, as it contains too many unique words";
- } elsif ($dbh->errstr =~ /invalid byte sequence/) {
+ } elsif ( $dbh->err == 7 && $dbh->state eq '22021' ) {
warn "Attachment @{[$attachment->id]} cannot be indexed, as it contains invalid UTF8 bytes";
} else {
die "error: ". $dbh->errstr;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list