a2a_client/error.rs
1//! Error types for the a2a-client library.
2
3use thiserror::Error;
4
5/// Errors that can occur when using the A2A client.
6#[derive(Error, Debug)]
7pub enum ClientError {
8 /// Error from the underlying A2A protocol client
9 #[error("A2A protocol error: {0}")]
10 A2AError(#[from] a2a_rs::A2AError),
11
12 /// WebSocket is not configured
13 #[error("WebSocket client not configured")]
14 WebSocketNotConfigured,
15
16 /// Transport auto-detection failed
17 #[error("Failed to auto-detect available transports: {0}")]
18 AutoDetectionFailed(String),
19
20 /// Invalid configuration
21 #[error("Invalid configuration: {0}")]
22 InvalidConfiguration(String),
23}
24
25/// Specialized Result type for client operations
26pub type Result<T> = std::result::Result<T, ClientError>;