use crate::ssh::{SshKeyExchangeProcessingError, SshMessageID}; use thiserror::Error; #[derive(Debug, Error)] pub enum OperationalError { #[error("Configuration error")] ConfigurationError, #[error("Failed to connect to target address")] Connection, #[error("Failed to complete initial read: {0}")] InitialRead(std::io::Error), #[error("SSH banner was not formatted in UTF-8: {0}")] BannerError(std::str::Utf8Error), #[error("Invalid initial SSH versionling line: {line}")] InvalidHeaderLine { line: String }, #[error("Error writing initial banner: {0}")] WriteBanner(std::io::Error), #[error("Unexpected disconnect from other side.")] Disconnect, #[error("{message} in unexpected place.")] UnexpectedMessage { message: SshMessageID }, #[error("User authorization failed.")] UserAuthFailed, #[error("Request failed.")] RequestFailed, #[error("Failed to open channel.")] OpenChannelFailure, #[error("Other side closed connection.")] OtherClosed, #[error("Other side sent EOF.")] OtherEof, #[error("Channel failed.")] ChannelFailure, #[error("Error in initial handshake: {0}")] KeyxProcessingError(#[from] SshKeyExchangeProcessingError), #[error("Call into random number generator failed: {0}")] RngFailure(#[from] rand::Error), #[error("Invalid port number '{port_string}': {error}")] InvalidPort { port_string: String, error: std::num::ParseIntError, }, #[error("Invalid hostname '{0}'")] InvalidHostname(String), #[error("Unable to parse host address")] UnableToParseHostAddress, }