title: How to handle Net::SFTP::Foreign invalid user or password errors?
body: <p>I am using Net::SFTP::Foreign with IO::Pty. </p>
  
  <p>My Login Command is:</p>
  
  <pre><code>Net::SFTP::Foreign-&gt;new(host=&gt; $server_address,
                          user =&gt; $user_id,
                          password =&gt; $password)
      or die "Could not Connect To Server $server_address: $!"; 
  </code></pre>
  
  <p>When I am passing invalid entry for server/user/password, it's not throwing the error message. It's simply hanging on the command line and not giving any output ever after 30+ minutes.</p>
  
  <p>Please help how to handle the errors, if there is any invalid input parameters.</p>
  
  <p>If I am passing all the valid values, its working fine.</p>