1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 22:19:38 +00:00

fhem.pl: add errors to initial error message, remove list of modules from the error message, if a module is not found.

git-svn-id: https://svn.fhem.de/fhem/trunk@5442 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-04-05 06:23:39 +00:00
parent 3258bc64a4
commit c7812a0e34

View File

@ -433,7 +433,7 @@ while(time() < 2*3600) {
sleep(5); sleep(5);
} }
my $cfgErrMsg = "There were error messages while initializing FHEM"; my $cfgErrMsg = "Error messages while initializing FHEM:";
my $cfgRet=""; my $cfgRet="";
if($attr{global}{configfile} eq 'configDB') { if($attr{global}{configfile} eq 'configDB') {
my $ret = cfgDB_ReadAll(undef); my $ret = cfgDB_ReadAll(undef);
@ -450,7 +450,7 @@ if($attr{global}{configfile} eq 'configDB') {
} }
if($cfgRet) { if($cfgRet) {
$attr{global}{motd} = "$cfgErrMsg,\ncheck the Logfile for details."; $attr{global}{motd} = "$cfgErrMsg\n$cfgRet";
Log 1, $cfgRet; Log 1, $cfgRet;
} elsif($attr{global}{motd} =~ m/^$cfgErrMsg/) { } elsif($attr{global}{motd} =~ m/^$cfgErrMsg/) {
@ -1521,11 +1521,7 @@ CommandDefine($$)
return "Cannot load module $m" if($newm eq "UNDEFINED"); return "Cannot load module $m" if($newm eq "UNDEFINED");
$m = $newm; $m = $newm;
if(!$modules{$m} || !$modules{$m}{DefFn}) { return "Unknown module $m" if(!$modules{$m} || !$modules{$m}{DefFn});
my @m = grep { $modules{$_}{DefFn} || !$modules{$_}{LOADED} }
sort keys %modules;
return "Unknown module $m, choose one of @m";
}
my %hash; my %hash;