#[non_exhaustive]pub enum ClientError {
Http(Error),
HttpClient(String),
Serialization(Error),
Protocol(A2aError),
Transport(String),
InvalidEndpoint(String),
UnexpectedStatus {
status: u16,
body: String,
},
AuthRequired {
task_id: TaskId,
},
Timeout(String),
ProtocolBindingMismatch(String),
}Expand description
Errors that can occur during A2A client operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(Error)
A transport-level HTTP error from hyper.
HttpClient(String)
An HTTP-level error from the hyper-util client (connection, redirect, etc.).
Serialization(Error)
JSON serialization or deserialization error.
Protocol(A2aError)
A protocol-level A2A error returned by the server.
Transport(String)
A transport configuration or connection error.
InvalidEndpoint(String)
The agent endpoint URL is invalid or could not be resolved.
UnexpectedStatus
The server returned an unexpected HTTP status code.
Fields
AuthRequired
The agent requires authentication for this task.
Timeout(String)
A request or stream connection timed out.
ProtocolBindingMismatch(String)
The server appears to use a different protocol binding than the client.
For example, a JSON-RPC client connected to a REST-only server (or
vice-versa). Check the agent card’s supported_interfaces to select
the correct protocol binding.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true if this error is transient and the request should be retried.
Retryable errors include:
- HTTP connection/transport errors
- Timeouts
- Server errors (HTTP 502, 503, 504, 429)
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<A2aError> for ClientError
impl From<A2aError> for ClientError
Source§impl From<Error> for ClientError
impl From<Error> for ClientError
Auto Trait Implementations§
impl Freeze for ClientError
impl !RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
impl !UnwindSafe for ClientError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request