openssh_mux_client_error/
lib.rs

1use std::io;
2use thiserror::Error as ThisError;
3
4pub use ssh_format_error::Error as SshFormatError;
5
6#[derive(Debug, ThisError)]
7#[non_exhaustive]
8pub enum Error {
9    /// Server speaks multiplex protocol other than protocol 4.
10    #[error("Server speaks multiplex protocol other than protocol 4.")]
11    UnsupportedMuxProtocol,
12
13    /// Server response with unexpected package type {0}: Response {1:#?}.
14    #[error("Server response with unexpected package type: expected {0}, actual response {1:#?}.")]
15    InvalidServerResponse(&'static &'static str, Box<str>),
16
17    /// Server response with port = 0.
18    #[error("Server response with port = 0.")]
19    InvalidPort,
20
21    /// Server response with pid = 0.
22    #[error("Server response with pid = 0.")]
23    InvalidPid,
24
25    /// Server response with a different id than the requested one.
26    #[error("Server response with a different id than the requested one.")]
27    UnmatchedRequestId,
28
29    /// Server response with a different session_id.
30    #[error("Server response with a different session_id.")]
31    UnmatchedSessionId,
32
33    /// IO Error (Excluding `EWOULDBLOCK`): {0}.
34    #[error("IO Error (Excluding `EWOULDBLOCK`): {0}.")]
35    IOError(#[from] io::Error),
36
37    /// Failed to serialize/deserialize the message: {0}.
38    #[error("Failed to serialize/deserialize the message: {0}.")]
39    FormatError(#[from] SshFormatError),
40
41    /// Server refused the request: {0}.
42    #[error("Server refused the request: {0}.")]
43    RequestFailure(Box<str>),
44
45    /// Server refused the request due to insufficient permission: {0}.
46    #[error("Server refused the request due to insufficient permission: {0}.")]
47    PermissionDenied(Box<str>),
48}