$log->debug("creating $uri");
my $doc = $self->{invindex}->new_doc( $uri ) || $log->logdie("can't create new_doc( $uri )");
- eval { $doc->set_value('uri', $self->convert($uri) ) };
+
+ sub add_value($$) {
+ my ($n,$v) = @_;
+ eval { $doc->set_value($n, $self->convert($v) ) };
+ $log->warn("can't insert: $n = $v") if ($@);
+ }
+
+ add_value('uri', $uri);
$log->debug("ds = ", sub { Dumper($args->{'ds'}) } );
$vals = $self->convert( $vals ) or
$log->logdie("can't convert '$vals' to UTF-8");
- eval { $doc->set_value( $tag, $vals ) };
+ add_value( $tag, $vals );
}
- my $text = $args->{'text'};
- if ( $text ) {
- $text = $self->convert( $text ) or
- $log->logdie("can't convert '$text' to UTF-8");
- eval { $doc->set_value( bodytext => $text ) };
+ if (my $text = $args->{'text'}) {
+ add_value( 'bodytext', $text );
}
#$log->debug("adding ", sub { $doc->dump_draft } );