openssh_mux_client_error/
lib.rs1use 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 #[error("Server speaks multiplex protocol other than protocol 4.")]
11 UnsupportedMuxProtocol,
12
13 #[error("Server response with unexpected package type: expected {0}, actual response {1:#?}.")]
15 InvalidServerResponse(&'static &'static str, Box<str>),
16
17 #[error("Server response with port = 0.")]
19 InvalidPort,
20
21 #[error("Server response with pid = 0.")]
23 InvalidPid,
24
25 #[error("Server response with a different id than the requested one.")]
27 UnmatchedRequestId,
28
29 #[error("Server response with a different session_id.")]
31 UnmatchedSessionId,
32
33 #[error("IO Error (Excluding `EWOULDBLOCK`): {0}.")]
35 IOError(#[from] io::Error),
36
37 #[error("Failed to serialize/deserialize the message: {0}.")]
39 FormatError(#[from] SshFormatError),
40
41 #[error("Server refused the request: {0}.")]
43 RequestFailure(Box<str>),
44
45 #[error("Server refused the request due to insufficient permission: {0}.")]
47 PermissionDenied(Box<str>),
48}