Subject: | Net::SFTP error handling on bad login |
Dist. name and version: Net::SFTP 1.30 2005/01/16 21:36:56 dbrobins
Perl Version: v5.8.3 built for i686-linux
Operating System: Linux myserver.com 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686 i686 i386 GNU/Linux
When trying to connect using Net::SFTP, I'm wondering if there's a way to trap or check the connection status. Example:
my $sftp=SFTP2->new($server, user => $user, password=>$pass, warn=>0)
if(!$sftp) {
#run error controls here
}
Right now, when I purposely use a bad password, I would get this:
Permission denied at /usr/lib/perl5/site_perl/5.8.3/Net/SFTP.pm line 62
Line 62 of SFTP.pm is:
$ssh->login($param{user}, $param{password})
It dies there.
Is there anyway to work around this or is there a fix or possible patch/fix for future releases?