async_ssh2_tokio/
error.rs

1use std::io;
2
3/// This is the `thiserror` error for all crate errors.
4///
5/// Most ssh related error is wrapped in the `SshError` variant,
6/// giving access to the underlying [`russh::Error`] type.
7#[derive(thiserror::Error, Debug)]
8#[non_exhaustive]
9pub enum Error {
10    #[error("Keyboard-interactive authentication failed")]
11    KeyboardInteractiveAuthFailed,
12    #[error("No keyboard-interactive response for prompt: {0}")]
13    KeyboardInteractiveNoResponseForPrompt(String),
14    #[error("Key authentication failed")]
15    KeyAuthFailed,
16    #[error("Unable to load key, bad format or passphrase: {0}")]
17    KeyInvalid(russh::keys::Error),
18    #[error("Password authentication failed")]
19    PasswordWrong,
20    #[error("Invalid address was provided: {0}")]
21    AddressInvalid(io::Error),
22    #[error("The executed command didn't send an exit code")]
23    CommandDidntExit,
24    #[error("Server check failed")]
25    ServerCheckFailed,
26    #[error("Ssh error occured: {0}")]
27    SshError(#[from] russh::Error),
28    #[error("Send error")]
29    SendError(#[from] russh::SendError),
30    #[error("Agent auth error")]
31    AgentAuthError(#[from] russh::AgentAuthError),
32    #[error("Failed to connect to SSH agent")]
33    AgentConnectionFailed,
34    #[error("Failed to request identities from SSH agent")]
35    AgentRequestIdentitiesFailed,
36    #[error("SSH agent has no identities")]
37    AgentNoIdentities,
38    #[error("SSH agent authentication failed")]
39    AgentAuthenticationFailed,
40    #[error("SFTP error occured: {0}")]
41    SftpError(#[from] russh_sftp::client::error::Error),
42    #[error("I/O error")]
43    IoError(#[from] io::Error),
44}