diff options
author | Sven Nierlein <sven@nierlein.org> | 2018-05-28 08:55:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-28 08:55:47 +0200 |
commit | f4b90a56b819a219a147860deb3248883f86c0a8 (patch) | |
tree | 2fc66a50614dffea3c5aefdedddf2075f7802c81 /lib/Monitoring/Plugin | |
parent | 8180da509371afd3f3044b494a8cb87e70e73d64 (diff) | |
parent | 301a3564e6b7cf716b75440c5333e688ea814873 (diff) | |
download | monitoring-plugin-perl-f4b90a56b819a219a147860deb3248883f86c0a8.tar.gz |
Merge pull request #19 from tejr/config-read-error
Fail with config ->errstr() when undef read
Diffstat (limited to 'lib/Monitoring/Plugin')
-rw-r--r-- | lib/Monitoring/Plugin/Getopt.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm index c8033d0..1810fde 100644 --- a/lib/Monitoring/Plugin/Getopt.pm +++ b/lib/Monitoring/Plugin/Getopt.pm | |||
@@ -260,7 +260,9 @@ sub _load_config_section | |||
260 | 260 | ||
261 | my $Config; | 261 | my $Config; |
262 | eval { $Config = Monitoring::Plugin::Config->read($file); }; | 262 | 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); | ||
264 | 266 | ||
265 | # TODO: is this check sane? Does --extra-opts=foo require a [foo] section? | 267 | # TODO: is this check sane? Does --extra-opts=foo require a [foo] section? |
266 | ## Nevertheless, if we die as UNKNOWN here we should do the same on default | 268 | ## Nevertheless, if we die as UNKNOWN here we should do the same on default |