Skip to main content

acp_utils/client/
error.rs

1/// Errors returned by ACP client-side operations.
2#[derive(Debug, thiserror::Error)]
3pub enum AcpClientError {
4    /// The agent command string could not be parsed / the subprocess could
5    /// not be spawned.
6    #[error("invalid agent command: {0}")]
7    InvalidAgentCommand(#[source] agent_client_protocol::Error),
8
9    /// The transport could not be established before the ACP handshake.
10    #[error("ACP connection failed before handshake: {0}")]
11    ConnectFailed(#[source] agent_client_protocol::Error),
12
13    /// The agent subprocess exited unexpectedly.
14    #[error("agent subprocess crashed: {0}")]
15    AgentCrashed(String),
16
17    /// The ACP request/response exchange failed (`initialize`, `new_session`,
18    /// `prompt`, etc.).
19    #[error("ACP protocol error: {0}")]
20    Protocol(#[source] agent_client_protocol::Error),
21}