pub enum A2AError {
Show 17 variants
JsonRpc {
code: i32,
message: String,
data: Option<Value>,
},
JsonParse(Error),
InvalidRequest(String),
InvalidParams(String),
MethodNotFound(String),
TaskNotFound(String),
TaskNotCancelable(String),
PushNotificationNotSupported,
UnsupportedOperation(String),
ContentTypeNotSupported(String),
InvalidAgentResponse(String),
AuthenticatedExtendedCardNotConfigured,
Internal(String),
ValidationError {
field: String,
message: String,
},
VersionConflict {
id: String,
expected: u64,
actual: u64,
},
DatabaseError(String),
Io(Error),
}Expand description
Error type for the A2A protocol operations
Variants§
JsonRpc
JsonParse(Error)
InvalidRequest(String)
InvalidParams(String)
MethodNotFound(String)
TaskNotFound(String)
TaskNotCancelable(String)
PushNotificationNotSupported
UnsupportedOperation(String)
ContentTypeNotSupported(String)
InvalidAgentResponse(String)
AuthenticatedExtendedCardNotConfigured
Internal(String)
ValidationError
VersionConflict
DatabaseError(String)
Io(Error)
Implementations§
Source§impl A2AError
impl A2AError
Sourcepub fn to_jsonrpc_error(&self) -> Value
pub fn to_jsonrpc_error(&self) -> Value
Convert an A2AError to a JSON-RPC error value
Sourcepub fn reason_code(&self) -> &'static str
pub fn reason_code(&self) -> &'static str
Stable, machine-readable reason code for this error
(SCREAMING_SNAKE_CASE, used as the ErrorInfo.reason on the wire).
Sourcepub fn error_details(&self) -> Vec<ErrorDetail>
pub fn error_details(&self) -> Vec<ErrorDetail>
Typed details for the JSON-RPC error.data array.
Validation failures surface as a Google-RPC BadRequest with field
violations; version conflicts attach the expected/actual versions as
ErrorInfo metadata; every other variant carries at least its stable
reason_code as an ErrorInfo, so a client can
branch on a machine code instead of parsing the message string.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<HttpClientError> for A2AError
Available on crate features http-client or jsonrpc-client only.
impl From<HttpClientError> for A2AError
Available on crate features
http-client or jsonrpc-client only.Source§fn from(error: HttpClientError) -> Self
fn from(error: HttpClientError) -> Self
Converts to this type from the input type.
Source§impl From<HttpServerError> for A2AError
Available on crate feature http-server only.
impl From<HttpServerError> for A2AError
Available on crate feature
http-server only.Source§fn from(error: HttpServerError) -> Self
fn from(error: HttpServerError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for A2AError
impl !UnwindSafe for A2AError
impl Freeze for A2AError
impl Send for A2AError
impl Sync for A2AError
impl Unpin for A2AError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more