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.
5    #[error("invalid agent command: {0}")]
6    InvalidAgentCommand(#[source] agent_client_protocol::Error),
7
8    /// The transport could not be established before the ACP handshake.
9    #[error("ACP connection failed before handshake: {0}")]
10    ConnectFailed(#[source] agent_client_protocol::Error),
11
12    /// The agent subprocess exited unexpectedly.
13    #[error("agent subprocess crashed: {0}")]
14    AgentCrashed(String),
15
16    /// The ACP request/response exchange failed (`initialize`, `new_session`,
17    /// `prompt`, etc.).
18    #[error("ACP protocol error: {0}")]
19    Protocol(#[source] agent_client_protocol::Error),
20}