1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum AcpError {
8 #[error("failed to spawn ACP agent: {0}")]
10 Spawn(String),
11
12 #[error("ACP protocol error: {0}")]
14 Protocol(String),
15
16 #[error("ACP agent error: {0}")]
18 AgentError(String),
19
20 #[error("ACP connection lost: {0}")]
22 ConnectionLost(String),
23
24 #[error("ACP agent timed out after {0}ms")]
26 Timeout(u64),
27
28 #[error("invalid ACP agent config: {0}")]
30 InvalidConfig(String),
31}
32
33impl From<AcpError> for adk_core::AdkError {
34 fn from(err: AcpError) -> Self {
35 adk_core::AdkError::tool(err.to_string())
36 }
37}
38
39pub type Result<T> = std::result::Result<T, AcpError>;