mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
Reloading .pm files / returning error when compile failed
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1462 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4fb8ba3466
commit
059c0ab0b7
9
fhem.pl
9
fhem.pl
@ -1539,12 +1539,11 @@ CommandReload($$)
|
|||||||
Log 5, "Loading $file";
|
Log 5, "Loading $file";
|
||||||
|
|
||||||
no strict "refs";
|
no strict "refs";
|
||||||
eval {
|
my $ret = eval {
|
||||||
my $ret=do "$file";
|
my $ret=do "$file";
|
||||||
if(!$ret) {
|
if(!$ret) {
|
||||||
Log 1, "reload: Error:Modul $param deactivated:\n $@";
|
Log 1, "reload: Error:Modul $param deactivated:\n $@";
|
||||||
use strict "refs";
|
return $@;
|
||||||
return "$@";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the name of the initialize function. This may differ from the
|
# Get the name of the initialize function. This may differ from the
|
||||||
@ -1556,12 +1555,14 @@ CommandReload($$)
|
|||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ret = &{ "${fnname}_Initialize" }(\%hash);
|
&{ "${fnname}_Initialize" }(\%hash);
|
||||||
$m = $fnname;
|
$m = $fnname;
|
||||||
|
return undef;
|
||||||
};
|
};
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
|
|
||||||
return "$@" if($@);
|
return "$@" if($@);
|
||||||
|
return $ret if($ret);
|
||||||
|
|
||||||
my ($defptr, $ldata);
|
my ($defptr, $ldata);
|
||||||
if($modules{$m}) {
|
if($modules{$m}) {
|
||||||
|
@ -1560,6 +1560,7 @@ FW_style($$)
|
|||||||
print FH $FW_data;
|
print FH $FW_data;
|
||||||
close(FH);
|
close(FH);
|
||||||
my $ret = FW_fC("rereadcfg") if($fName eq $attr{global}{configfile});
|
my $ret = FW_fC("rereadcfg") if($fName eq $attr{global}{configfile});
|
||||||
|
$ret = FW_fC("reload $1") if($fName =~ m,.*/([^/]*).pm,);
|
||||||
$ret = ($ret ? "<h3>ERROR:</h3><b>$ret</b>" : "Saved the file $fName");
|
$ret = ($ret ? "<h3>ERROR:</h3><b>$ret</b>" : "Saved the file $fName");
|
||||||
FW_style("style list", $ret);
|
FW_style("style list", $ret);
|
||||||
$ret = "";
|
$ret = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user