--- lib/Strix.pm 2008/06/16 19:05:05 177 +++ lib/Strix.pm 2008/06/16 22:17:06 185 @@ -9,6 +9,7 @@ use DBI; use Data::Dump qw/dump/; use Carp qw/confess/; +use Jifty; our $debug = 0; @@ -51,7 +52,7 @@ Jifty->log->info("Connect to instance $instance with dsn $dsn"); - my $dbh = DBI->connect( $dsn, $database->{user}, $database->{passwd} ) or die $DBI::errstr; + my $dbh = DBI->connect( $dsn, $database->{user}, $database->{passwd} ) or die "$DBI::errstr\n"; $instance_dbh->{$instance} = $dbh; @@ -235,6 +236,11 @@ } my $depth = $kat->{depth}; + if ( ! defined $pos[ $depth - 2 ] ) { + warn "FIXING CATEGORY: ",dump( $kat ); + $node->{class} = "error"; + $depth--; + } @pos = splice( @pos, 0, $depth ); $pos[ $depth - 1 ]++;