better error message
This commit is contained in:
parent
f9f49c3c36
commit
f12d1a7252
1 changed files with 3 additions and 2 deletions
|
|
@ -330,11 +330,12 @@ sub new {
|
|||
my $webguiPath = shift;
|
||||
my $filename = shift;
|
||||
my $noCache = shift;
|
||||
my $fullPath = $webguiPath.'/etc/'.$filename;
|
||||
if (exists $config{$filename}) {
|
||||
return $config{$filename};
|
||||
} else {
|
||||
my $json = "";
|
||||
if (open(my $FILE,"<",$webguiPath.'/etc/'.$filename)) {
|
||||
if (open(my $FILE,"<",$fullPath)) {
|
||||
while (my $line = <$FILE>) {
|
||||
$json .= $line unless ($line =~ /^\s*#/);
|
||||
}
|
||||
|
|
@ -347,7 +348,7 @@ sub new {
|
|||
$config{$filename} = $self unless $noCache;
|
||||
return $self;
|
||||
} else {
|
||||
warn "Cannot open config file: ".$filename;
|
||||
warn "Cannot open config file: ".$fullPath;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue