@staticmethod<EOL><INDENT>def convert_errno(e):<DEDENT>
if e == errno.EACCES:<EOL><INDENT>return SFTP_PERMISSION_DENIED<EOL><DEDENT>elif (e == errno.ENOENT) or (e == errno.ENOTDIR):<EOL><INDENT>return SFTP_NO_SUCH_FILE<EOL><DEDENT>else:<EOL><INDENT>return SFTP_FAILURE<EOL><DEDENT>
Convert an errno value (as from an ``OSError`` or ``IOError``) into a
standard SFTP result code.  This is a convenience function for trapping
exceptions in server code and returning an appropriate result.

:param int e: an errno code, as from ``OSError.errno``.
:return: an `int` SFTP error code like ``SFTP_NO_SUCH_FILE``.