ssh_agent_lib/proto/
error.rs1use std::{io, string};
4
5use thiserror::Error;
6
7#[derive(Debug, Error)]
9pub enum ProtoError {
10 #[error("String encoding failed: {0}")]
12 StringEncoding(#[from] string::FromUtf8Error),
13
14 #[error("I/O Error: {0}")]
16 IO(#[from] io::Error),
17
18 #[error("SSH encoding error: {0}")]
20 SshEncoding(#[from] ssh_encoding::Error),
21
22 #[error("SSH key error: {0}")]
24 SshKey(#[from] ssh_key::Error),
25
26 #[error("SSH signature error: {0}")]
28 SshSignature(#[from] signature::Error),
29
30 #[error("Command not supported ({command})")]
32 UnsupportedCommand {
33 command: u8,
35 },
36
37 #[error("Unexpected response received")]
39 UnexpectedResponse,
40}
41
42pub type ProtoResult<T> = Result<T, ProtoError>;