Safe Haskell | None |
---|---|
Language | Haskell98 |
- data ErrorCode
- = NONE
- | SOCKET_NONE
- | BANNER_RECV
- | BANNER_SEND
- | INVALID_MAC
- | KEX_FALIURE
- | ALLOC
- | SOCKET_SEND
- | KEY_EXCHANGE_FAILURE
- | TIMEOUT
- | HOSTKEY_INIT
- | HOSTKEY_SIGN
- | DECRYPT
- | SOCKET_DISCONNECT
- | PROTO
- | PASSWORD_EXPIRED
- | FILE
- | METHOD_NONE
- | AUTHENTICATION_FAILED
- | PUBLICKEY_UNVERIFIED
- | CHANNEL_OUTOFORDER
- | CHANNEL_FAILURE
- | CHANNEL_REQUEST_DENIED
- | CHANNEL_UNKNOWN
- | CHANNEL_WINDOW_EXCEEDED
- | CHANNEL_PACKET_EXCEEDED
- | CHANNEL_CLOSED
- | CHANNEL_EOF_SENT
- | SCP_PROTOCOL
- | ZLIB
- | SOCKET_TIMEOUT
- | SFTP_PROTOCOL
- | REQUEST_DENIED
- | METHOD_NOT_SUPPORTED
- | INVAL
- | INVALID_POLL_TYPE
- | PUBLICKEY_PROTOCOL
- | EAGAIN
- | BUFFER_TOO_SMALL
- | BAD_USE
- | COMPRESS
- | OUT_OF_BOUNDARY
- | AGENT_PROTOCOL
- | SOCKET_RECV
- | ENCRYPT
- | BAD_SOCKET
- | ERROR_KNOWN_HOSTS
- data SftpErrorCode
- = FX_OK
- | FX_EOF
- | FX_NO_SUCH_FILE
- | FX_PERMISSION_DENIED
- | FX_FAILURE
- | FX_BAD_MESSAGE
- | FX_NO_CONNECTION
- | FX_CONNECTION_LOST
- | FX_OP_UNSUPPORTED
- | FX_INVALID_HANDLE
- | FX_NO_SUCH_PATH
- | FX_FILE_ALREADY_EXISTS
- | FX_WRITE_PROTECT
- | FX_NO_MEDIA
- | FX_NO_SPACE_ON_FILESYSTEM
- | FX_QUOTA_EXCEEDED
- | FX_UNKNOWN_PRINCIPAL
- | FX_LOCK_CONFLICT
- | FX_DIR_NOT_EMPTY
- | FX_NOT_A_DIRECTORY
- | FX_INVALID_FILENAME
- | FX_LINK_LOOP
- data NULL_POINTER
- class IntResult a where
- getLastError :: Session -> IO (Int, String)
- getLastSftpError :: Sftp -> IO Int
- handleInt :: (IntResult a, SshCtx ctx) => Maybe ctx -> IO a -> IO a
- handleBool :: CInt -> IO Bool
- handleNullPtr :: SshCtx c => Maybe c -> (Ptr () -> IO a) -> IO (Ptr ()) -> IO a
- int2error :: Integral i => i -> ErrorCode
- error2int :: Num i => ErrorCode -> i
- int2sftperror :: Integral i => i -> SftpErrorCode
- sftperror2int :: Num i => SftpErrorCode -> i
- blockedDirections :: Session -> IO [Direction]
- threadWaitSession :: SshCtx ctx => Maybe ctx -> IO ()
Types
Error codes returned by libssh2.
data SftpErrorCode Source #
Sftp error code returning from libssh2
data NULL_POINTER Source #
Exception to throw when null pointer received from libssh2.
Utilities
Functions
handleInt :: (IntResult a, SshCtx ctx) => Maybe ctx -> IO a -> IO a Source #
Throw an exception if negative value passed, or return unchanged value.
handleNullPtr :: SshCtx c => Maybe c -> (Ptr () -> IO a) -> IO (Ptr ()) -> IO a Source #
Throw an exception if null pointer passed, or return it casted to right type.
int2sftperror :: Integral i => i -> SftpErrorCode Source #
sftperror2int :: Num i => SftpErrorCode -> i Source #
threadWaitSession :: SshCtx ctx => Maybe ctx -> IO () Source #