diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2021-08-24 00:35:38 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2021-08-24 00:40:44 +1200 |
commit | 821c56da619f4735717987aa28a4e25c19e27d6f (patch) | |
tree | a19f03fbc98adfa4e0d6bb8b94dc6a462f8960a5 | |
parent | Relicense from MIT to GPLv3+ (diff) | |
download | nagios-check-ftp-821c56da619f4735717987aa28a4e25c19e27d6f.tar.gz nagios-check-ftp-821c56da619f4735717987aa28a4e25c19e27d6f.zip |
Use specific exception name
-rw-r--r-- | libexec/check_ftp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/check_ftp b/libexec/check_ftp index 3ff4654..ca44420 100644 --- a/libexec/check_ftp +++ b/libexec/check_ftp @@ -34,7 +34,7 @@ use 5.010_001; # Import required modules use English qw(-no_match_vars); -use Exception::Class ( PluginException => { alias => 'throw' } ); +use Exception::Class qw(TLSException); use Monitoring::Plugin; use Net::FTP; use Try::Tiny; @@ -98,7 +98,7 @@ try { # If we connected and the server reports that it supports TLS, try it if ( defined $mp->opts->starttls ) { my $ssl = $ftp->can_ssl - or throw 'Client can\'t TLS'; + or TLSException->throw('Client can\'t TLS'); $ftp->feature('AUTH TLS') or $mp->add_message( WARNING => 'AUTH TLS not listed in features' ); $ftp->starttls |