#[non_exhaustive]pub enum ConnectError {
Connect {
path: PathBuf,
source: Error,
},
Io(Error),
Wire(WireError),
HandshakeClosed,
HandshakeTimeout {
after: Duration,
},
ProtocolMismatch {
client: u32,
daemon_version: Option<String>,
message: String,
},
Destination(DestinationError),
Ssh {
destination: String,
cause: SshCause,
},
}Expand description
Why Connection::open failed.
Non-exhaustive: expect more variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect
connect(2) itself failed: nothing is listening at path (no
socket file, permission denied, connection refused, …).
Io(Error)
A framed read or write failed after the connection was established.
Wire(WireError)
The Hello failed to encode, or the reply frame failed to decode.
HandshakeClosed
The peer closed the connection before a HelloReply arrived.
HandshakeTimeout
Connect succeeded but no HelloReply (and no close) arrived within
the timeout. Distinct from Self::Connect: a refusal means nothing
is listening, a timeout means something is bound but not answering.
ProtocolMismatch
The daemon refused the handshake on protocol-version skew. client
is this client’s own PROTOCOL_VERSION; message is the
daemon’s own sentence, not meant for parsing.
Fields
Destination(DestinationError)
The destination handed to Client::connect_ssh_with is not one
Destination::parse accepts. Nothing was spawned.
Ssh
Dialling destination through ssh failed; cause says how.
Implementations§
Source§impl ConnectError
impl ConnectError
Sourcepub const fn exit_code(&self) -> u8
pub const fn exit_code(&self) -> u8
The shep_core::exit code a process stopping on this error uses:
a refusal is a protocol mismatch, a destination ssh would misread is a
usage error, and every other stage is nothing usable answering.
Trait Implementations§
Source§impl Debug for ConnectError
impl Debug for ConnectError
Source§impl Display for ConnectError
impl Display for ConnectError
Source§impl Error for ConnectError
impl Error for ConnectError
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()