Skip to content

Commit f4b90a5

Browse files
authored
Merge pull request #19 from tejr/config-read-error
Fail with config ->errstr() when undef read
2 parents 8180da5 + 301a356 commit f4b90a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Monitoring/Plugin/Getopt.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ sub _load_config_section
260260

261261
my $Config;
262262
eval { $Config = Monitoring::Plugin::Config->read($file); };
263-
$self->_die($@) if ($@); #TODO: add test?
263+
$self->_die($@) if ($@);
264+
defined $Config
265+
or $self->_die(Monitoring::Plugin::Config->errstr);
264266

265267
# TODO: is this check sane? Does --extra-opts=foo require a [foo] section?
266268
## Nevertheless, if we die as UNKNOWN here we should do the same on default

0 commit comments

Comments
 (0)