pub enum A2AError {
Show 16 variants
TaskNotFound(String),
TaskNotCancelable(String),
PushNotificationNotSupported(String),
UnsupportedOperation(String),
ContentTypeNotSupported(String),
InvalidAgentResponse(String),
ExtendedAgentCardNotConfigured(String),
ExtensionSupportRequired(String),
VersionNotSupported(String),
ParseError(String),
InvalidRequest(String),
MethodNotFound(String),
InvalidParams(String),
Internal(String),
Serialization(Error),
Http(Error),
}Expand description
Unified error type for A2A protocol, HTTP, and serialization failures.
Variants§
TaskNotFound(String)
The requested task identifier does not exist.
TaskNotCancelable(String)
The requested task cannot transition to canceled.
PushNotificationNotSupported(String)
Push notifications are disabled or unsupported for this agent.
UnsupportedOperation(String)
The requested operation is not implemented.
ContentTypeNotSupported(String)
The request content type is not supported by the peer.
InvalidAgentResponse(String)
The remote agent returned an invalid response payload.
ExtendedAgentCardNotConfigured(String)
Extended agent card retrieval is not configured for the agent.
ExtensionSupportRequired(String)
A required extension is not supported by the peer.
VersionNotSupported(String)
The peer rejected the requested A2A protocol version.
ParseError(String)
The request body could not be parsed as valid JSON-RPC or JSON.
InvalidRequest(String)
The request shape is structurally invalid.
MethodNotFound(String)
The requested method or route does not exist.
InvalidParams(String)
The supplied parameters could not be deserialized or validated.
Internal(String)
An internal SDK or server error occurred.
Serialization(Error)
JSON serialization or deserialization failed locally.
Http(Error)
The underlying HTTP client returned an error.
Implementations§
Source§impl A2AError
impl A2AError
Sourcepub fn to_jsonrpc_error(&self) -> JsonRpcError
pub fn to_jsonrpc_error(&self) -> JsonRpcError
Convert this error into a JSON-RPC error object.
Sourcepub fn to_problem_details(&self) -> ProblemDetails
pub fn to_problem_details(&self) -> ProblemDetails
Convert this error into an RFC 9457-style HTTP problem payload.
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Return the HTTP status code associated with this error.
Sourcepub fn to_error_info(&self) -> ErrorInfo
pub fn to_error_info(&self) -> ErrorInfo
Convert this error into a structured ErrorInfo detail.
Sourcepub fn from_problem_details(problem: &ProblemDetails) -> Self
pub fn from_problem_details(problem: &ProblemDetails) -> Self
Reconstruct an A2AError from HTTP problem details when possible.
Trait Implementations§
Source§impl Error for A2AError
impl Error for A2AError
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()
Auto Trait Implementations§
impl Freeze for A2AError
impl !RefUnwindSafe for A2AError
impl Send for A2AError
impl Sync for A2AError
impl Unpin for A2AError
impl UnsafeUnpin for A2AError
impl !UnwindSafe for A2AError
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.