Commit 64b033ea authored by Stefan Tauner's avatar Stefan Tauner
Browse files

FIJI scripts: handle invalid settings file syntax

parent f373a2bc
......@@ -19,9 +19,10 @@ use Config::Simple;
sub read_configfile {
my $logger = get_logger();
my ($fiji_cfg_file) = @_;
my $fiji_cfg = new Config::Simple($fiji_cfg_file);
my $fiji_cfg;
eval { $fiji_cfg = new Config::Simple($fiji_cfg_file) }; # pesky library tries to die on syntax errors
if (!defined($fiji_cfg)) {
$logger->fatal("Could not read config file \"$fiji_cfg_file\": " . Config::Simple->error());
$logger->fatal("Could not read config file \"$fiji_cfg_file\": " . (defined($@) ? $@ : Config::Simple->error()));
return undef;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment