+15Jan23=======================================================================
+1. Fix strange errors for carp on missing route_*_cache files on startup.
14Jan23=======================================================================
1. Fixed route PC11 promotions so that a new PC61 is actually generated and
also sent instead of the original PC11 (to PC61 capable nodes).
}
};
if (!$@ && @s) {
- my $fh = IO::File->new(">$cachefn") or carp("writing $cachefn $!");
+ my $fh = IO::File->new(">$cachefn") or dbg("Route::Node: Error writing $cachefn $!"), return;
print $fh "$_" for (sort @s);
$fh->close;
} else {
my $ta = [ gettimeofday ];
my $count;
- my $fh = IO::File->new("$cachefn") or carp("reading $cachefn $!");
+ my $fh = IO::File->new("$cachefn") or dbg("Route::Node ERROR reading $cachefn $!"), return;
while (my $l = <$fh>) {
chomp $l;
my ($k, $v) = split /:/, $l, 2;
- $list{$k} = bless $json->decode($v) or carp("json error decoding '$v'");
+ $list{$k} = bless $json->decode($v) or carp("Route::Node json error $! decoding '$v'"), next;
++$count;
}
$fh->close if $fh;;
}
};
if (!$@ && @s) {
- my $fh = IO::File->new(">$cachefn") or carp("writing $cachefn $!");
+ my $fh = IO::File->new(">$cachefn") or dbg("Route::User: ERROR writing $cachefn $!"), return;
print $fh $_ for (sort @s);
$fh->close;
} else {
my $ta = [ gettimeofday ];
my $count;
- my $fh = IO::File->new("$cachefn") or carp("reading $cachefn $!");
+ my $fh = IO::File->new("$cachefn") or dbg("Route::User: ERROR reading $cachefn $!"), return;
while (my $l = <$fh>) {
chomp $l;
my ($k, $v) = split /:/, $l, 2;
- $list{$k} = bless $json->decode($v) or carp("json error decoding '$v'");
+ $list{$k} = bless $json->decode($v) or dbg("Route::User: Error json error $! decoding '$v'"), next;
++$count;
}
$fh->close if $fh;