74_AutomowerConnect: Common.pm: replace 'die' statement.

git-svn-id: https://svn.fhem.de/fhem/trunk@28619 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Ellert
2024-03-08 22:33:45 +00:00
parent 46ff71ec52
commit b3cbce3397

View File

@@ -2083,20 +2083,35 @@ sub readMap {
if ( $filename and -e $filename ) { if ( $filename and -e $filename ) {
open my $fh, '<:raw', $filename or die $!; if ( open my $fh, '<:raw', $filename ) {
my $content = ''; my $content = '';
while (1) { while (1) {
my $success = read $fh, $content, 1024, length($content); my $success = read $fh, $content, 1024, length( $content );
die $! if not defined $success;
if ( not defined $success ) {
close $fh;
Log3 $name, 1, "$iam read file \"$filename\" with error $!";
return;
}
last if not $success; last if not $success;
} }
close $fh; close $fh;
$hash->{helper}{MAP_CACHE} = $content; $hash->{helper}{MAP_CACHE} = $content;
Log3 $name, 5, "$iam file \"$filename\" content length: ".length($content); Log3 $name, 4, "$iam file \"$filename\" content length: ".length( $content );
} else {
Log3 $name, 1, "$iam open file \"$filename\" with error $!";
}
} else { } else {