#[non_exhaustive]pub enum AutosshError {
SshNotFound {
searched: Vec<PathBuf>,
},
MonitorBindFailed {
port: u16,
source: Error,
},
MaxStartReached {
attempts: u32,
},
MaxLifetimeReached,
PidfileWrite {
path: PathBuf,
source: Error,
},
LogfileWrite {
path: PathBuf,
source: Error,
},
Io(Error),
Daemonize {
reason: String,
},
Internal(&'static str),
}Expand description
Errors returned by the rusty-autossh library API.
Send + Sync + 'static per SC-009. #[non_exhaustive] per AD-014 so
additive variants are not a breaking change.
source() returns the wrapped inner error for wrapping variants (those
holding a source: io::Error field, the #[from] Io variant) and
None for leaf variants (no inner source).
§Example
use std::io;
use rusty_autossh::AutosshError;
// io::Error converts via `#[from]` (AD-014).
let io_err = io::Error::new(io::ErrorKind::NotFound, "boom");
let err: AutosshError = io_err.into();
match err {
AutosshError::Io(_) => {}
_ => unreachable!(),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SshNotFound
The ssh binary could not be resolved from AUTOSSH_PATH or any
entry in the host PATH. The searched field enumerates the
directories probed (in walk order) for diagnostic surfacing.
Fields
MonitorBindFailed
Failed to bind a monitor-port tokio::net::TcpListener on
127.0.0.1:<port> (typically EADDRINUSE or a permission error).
MaxStartReached
The consecutive-retry counter reached the AUTOSSH_MAXSTART cap
(or --max-start <n> CLI override). Maps to upstream’s
autossh: maximum retries reached stderr.
MaxLifetimeReached
AUTOSSH_MAXLIFETIME (or --max-lifetime <secs>) elapsed. Clean
self-termination; supervisor exits 0.
PidfileWrite
Atomic write of the pidfile failed at startup.
LogfileWrite
Failed to open/append to the logfile.
Io(Error)
Generic I/O error surfaced from underlying syscalls.
Daemonize
The daemonize crate or Windows CreateProcessW self-respawn
failed during -f background mode setup.
Internal(&'static str)
An internal invariant was violated. The &'static str payload is a
short diagnostic tag (never user-supplied content).
Trait Implementations§
Source§impl Debug for AutosshError
impl Debug for AutosshError
Source§impl Display for AutosshError
impl Display for AutosshError
Source§impl Error for AutosshError
impl Error for AutosshError
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()