Added exception handling in sftp file sending function