change Regex for error handling

This commit is contained in:
Marko Oldenburg 2021-04-24 15:36:11 +02:00
parent db6c9525b2
commit c9a14c1a4e
2 changed files with 5 additions and 5 deletions

View File

@ -1,2 +1,2 @@
UPD 2021-04-23_12:44:47 3363 FHEM/98_backup.pm UPD 2021-04-23_12:44:47 3363 FHEM/98_backup.pm
UPD 2021-04-23_17:20:10 8871 lib/FHEM/Core/Utils/FHEMbackup.pm UPD 2021-04-24_15:35:54 8885 lib/FHEM/Core/Utils/FHEMbackup.pm

View File

@ -67,12 +67,12 @@ sub CommandBackup {
$ret = addConfDBFiles( $configfile, $statefile ); $ret = addConfDBFiles( $configfile, $statefile );
return ::Log(1, qq(Backup ERROR - addConfDBFiles: $ret)) return ::Log(1, qq(Backup ERROR - addConfDBFiles: $ret))
if ( defined($ret) if ( defined($ret)
&& $ret =~ m{\ACan\'t\sopen.*}xms); && $ret =~ m{\ACan\'t\sopen.*:\s.*}xms);
$ret = readModpath( $modpath, $backupdir ); $ret = readModpath( $modpath, $backupdir );
return ::Log(1, qq(Backup ERROR - readModpath: $ret)) return ::Log(1, qq(Backup ERROR - readModpath: $ret))
if ( defined($ret) if ( defined($ret)
&& $ret =~ m{\ACan\'t\sopen.*}xms); && $ret =~ m{\ACan\'t\sopen\s\$modpath:\s.*}xms);
## add all logfile path to pathname array ## add all logfile path to pathname array
$ret = addLogPathToPathnameArray(); $ret = addLogPathToPathnameArray();
@ -199,7 +199,7 @@ sub readModpath {
my $ret; my $ret;
if ( !opendir( DH, $modpath ) ) { if ( !opendir( DH, $modpath ) ) {
$msg = 'Can\'t open $modpath: ' . $!; $msg = qq(Can't open \$modpath: $!);
::Log(1, qq(backup $msg)); ::Log(1, qq(backup $msg));
return $msg; return $msg;
} }