#[non_exhaustive]pub enum SshCliError {
Show 28 variants
Io(Error),
Json(Error),
TomlDe(Error),
TomlSer(Error),
Domain(DomainError),
SshConnection(String),
SshAuthentication(String),
ConnectionFailed(String),
AuthenticationFailed,
HostKeyChanged {
host: String,
port: u16,
expected: String,
obtained: String,
},
CommandTooLong {
max: usize,
len: usize,
},
SudoDisabled,
SuPasswordMissing,
ChannelFailed {
message: String,
source: Option<ErrorSource>,
},
SshTimeout(u64),
CommandFailed {
exit_code: i32,
stderr: String,
},
VpsNotFound(String),
NoActiveVps,
VpsDuplicate(String),
FileNotFound(String),
InvalidArgument(String),
Tls {
message: String,
source: Option<ErrorSource>,
},
Crypto {
op: &'static str,
},
Config(String),
Timeout(u64),
XdgDirectory,
SchemaIncompatible {
expected: u32,
found: u32,
},
Generic(String),
}Expand description
Domain errors produced by ssh-cli operations.
#[non_exhaustive] (G-SEC-11): external crates must use wildcard arms so
new variants in minor releases do not break SemVer consumers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Underlying I/O error.
Json(Error)
JSON serialization or deserialization error.
TomlDe(Error)
TOML deserialization error.
TomlSer(Error)
TOML serialization error.
Domain(DomainError)
Domain newtype / parse construction failure (G-ERR-02).
SshConnection(String)
SSH connection-layer error.
SshAuthentication(String)
SSH authentication error with detail.
ConnectionFailed(String)
TCP/SSH connection failed before authentication.
AuthenticationFailed
SSH authentication rejected by the server.
HostKeyChanged
Host key diverged from known_hosts (possible MITM).
Fields
CommandTooLong
Command exceeds max_command_chars.
SudoDisabled
Elevation disabled (disable_sudo).
SuPasswordMissing
Missing su password for su-exec.
ChannelFailed
Failed to open or operate an SSH channel (G-ERR-05: optional source chain).
Fields
source: Option<ErrorSource>Root cause when available.
SshTimeout(u64)
SSH operation timed out.
CommandFailed
Remote command exited non-zero.
VpsNotFound(String)
VPS name not found in the registry.
NoActiveVps
No active VPS (active sibling file missing) — GAP-SSH-EXIT-002.
VpsDuplicate(String)
Duplicate VPS name in the registry.
FileNotFound(String)
Local or remote file not found.
InvalidArgument(String)
Invalid CLI argument.
Tls
TLS layer error (handshake, config, PEM, ACME, mTLS) — G-ERR-04.
Fields
source: Option<ErrorSource>Root cause when available.
Crypto
Cryptographic / secrets key material failure (no secret bytes in Display).
Config(String)
Configuration / registry serialization failure (non-TOML crate errors).
Timeout(u64)
Generic timeout.
XdgDirectory
XDG config directory unavailable.
SchemaIncompatible
Incompatible schema version.
Generic(String)
Uncategorized error — last resort (prefer typed variants).
Implementations§
Source§impl SshCliError
impl SshCliError
Sourcepub fn tls_msg(message: impl AsRef<str>) -> Self
pub fn tls_msg(message: impl AsRef<str>) -> Self
TLS error with message only (no root cause).
Accepts &str / String via AsRef<str> to avoid Into ambiguity
with foreign From<&str> impls in the dependency graph.
Sourcepub fn tls_src(
message: impl AsRef<str>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn tls_src( message: impl AsRef<str>, source: impl Error + Send + Sync + 'static, ) -> Self
TLS error preserving [Error::source] (G-ERR-04 / G-ERR-16 DRY).
Sourcepub fn channel_msg(message: impl AsRef<str>) -> Self
pub fn channel_msg(message: impl AsRef<str>) -> Self
Channel error with message only.
Sourcepub fn channel_src(
message: impl AsRef<str>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn channel_src( message: impl AsRef<str>, source: impl Error + Send + Sync + 'static, ) -> Self
Channel error preserving source (G-ERR-05 / G-ERR-16 DRY).
Sourcepub fn crypto(op: &'static str) -> Self
pub fn crypto(op: &'static str) -> Self
Crypto / secrets failure without embedding secret material.
Sourcepub fn error_code(&self) -> &'static str
pub fn error_code(&self) -> &'static str
Stable machine-oriented code for JSON envelopes (G-ERR-08).
Sourcepub fn retry_kind(&self) -> RetryKind
pub fn retry_kind(&self) -> RetryKind
Typed retry kind (no string matching on Display).
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether an agent may re-invoke the CLI with the same argv after backoff.
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Explicit complement of Self::is_retryable.
Sourcepub fn classify(&self) -> ErrorClass
pub fn classify(&self) -> ErrorClass
High-level class for the JSON envelope error_class field.
Sourcepub fn layer(&self) -> ErrorLayer
pub fn layer(&self) -> ErrorLayer
Stack layer for diagnostics.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Optional cool-down hint (SSH has no HTTP Retry-After; always None).
Sourcepub fn suggestion(&self) -> Option<&'static str>
pub fn suggestion(&self) -> Option<&'static str>
Short agent-facing suggestion for the JSON envelope.
Trait Implementations§
Source§impl Debug for SshCliError
impl Debug for SshCliError
Source§impl Display for SshCliError
impl Display for SshCliError
Source§impl Error for SshCliError
impl Error for SshCliError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()