use std::path::PathBuf;
pub type AgentClientResult<T> = std::result::Result<T, AgentClientError>;
#[derive(Debug, thiserror::Error)]
pub enum AgentClientError {
#[error("connect {path}: {source}")]
Connect {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("handshake: {0}")]
Handshake(String),
#[error(
"filesystem and SFTP features need this sandbox to be restarted: this sandbox was started before microsandbox 0.5; stop and start it, then retry"
)]
Pre05SandboxRestartRequired,
#[error("sandbox '{0}' not found")]
SandboxNotFound(String),
#[error("invalid sandbox name: {0}")]
InvalidSandboxName(String),
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("protocol: {0}")]
Protocol(#[from] microsandbox_protocol::ProtocolError),
#[error("reader closed before response for id={0}")]
ReaderClosed(u32),
#[error("client closed")]
Closed,
}