Skip to content

Commit

Permalink
Let's look at ssh_error, too
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos committed May 14, 2021
1 parent ef85bb7 commit c25e01c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pylibsshext/sftp.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ cdef class SFTP:
written = sftp.sftp_write(rf, PyBytes_AS_STRING(buffer), length)
if written != length:
sftp.sftp_close(rf)
raise LibsshSFTPException("Writing to remote file [%s] failed with error [%s]" % (remote_file, MSG_MAP.get(self._get_sftp_error_str())))
raise LibsshSFTPException(
"Writing to remote file [%s] failed with error [%s: %s]" % (
remote_file,
MSG_MAP.get(self._get_sftp_error_str()),
self.session._get_session_error_str(),
)
)
buffer = f.read(1024)
sftp.sftp_close(rf)

Expand Down

0 comments on commit c25e01c

Please sign in to comment.