[Rt-commit] rt branch, 4.0/fix-indexer-error-handling, created. rt-4.0.11rc1-10-ge8bb11f

Ruslan Zakirov ruz at bestpractical.com
Mon Apr 1 13:17:35 EDT 2013


The branch, 4.0/fix-indexer-error-handling has been created
        at  e8bb11feff222a23ebc1af1b0860b2c75fd0d16c (commit)

- Log -----------------------------------------------------------------
commit e8bb11feff222a23ebc1af1b0860b2c75fd0d16c
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