#[non_exhaustive]pub enum A2aError {
TaskNotFound {
task_id: String,
},
TaskNotCancelable {
task_id: String,
},
PushNotificationNotSupported,
UnsupportedOperation {
message: String,
},
ContentTypeNotSupported {
content_type: String,
},
InvalidAgentResponse {
message: String,
},
ExtendedAgentCardNotConfigured,
ExtensionSupportRequired {
extension: String,
},
VersionNotSupported {
version: String,
},
InvalidRequest {
message: String,
},
Internal(String),
}Expand description
Server-level error for A2A operations.
Each variant corresponds to an A2A-specific error type from the spec with exact HTTP status, JSON-RPC code, and ErrorInfo reason mappings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TaskNotFound
TaskNotCancelable
PushNotificationNotSupported
UnsupportedOperation
ContentTypeNotSupported
InvalidAgentResponse
ExtendedAgentCardNotConfigured
ExtensionSupportRequired
VersionNotSupported
InvalidRequest
Internal(String)
Implementations§
Source§impl A2aError
impl A2aError
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
HTTP status code per spec Section 5.4.
Sourcepub fn jsonrpc_code(&self) -> i32
pub fn jsonrpc_code(&self) -> i32
JSON-RPC error code per spec Section 5.4 (-32001 to -32009). Non-A2A errors use standard JSON-RPC codes.
Sourcepub fn error_reason(&self) -> Option<&'static str>
pub fn error_reason(&self) -> Option<&'static str>
ErrorInfo reason string (UPPER_SNAKE_CASE, no “Error” suffix).
Returns None for non-A2A errors (InvalidRequest, Internal).
Sourcepub fn error_info(&self) -> Option<Value>
pub fn error_info(&self) -> Option<Value>
Build the google.rpc.ErrorInfo JSON object for this error.
Returns None for non-A2A errors.
Sourcepub fn to_http_error_body(&self) -> Value
pub fn to_http_error_body(&self) -> Value
Build the HTTP error response body per AIP-193.
Sourcepub fn to_jsonrpc_error(&self, id: Option<&Value>) -> Value
pub fn to_jsonrpc_error(&self, id: Option<&Value>) -> Value
Build the JSON-RPC error object.
Trait Implementations§
Source§impl Error for A2aError
impl Error for A2aError
1.30.0 · 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<A2aStorageError> for A2aError
impl From<A2aStorageError> for A2aError
Source§fn from(err: A2aStorageError) -> Self
fn from(err: A2aStorageError) -> Self
Source§impl IntoResponse for A2aError
impl IntoResponse for A2aError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Source§impl ToJsonRpcError for A2aError
Map A2aError onto turul-rpc’s JsonRpcErrorObject (code/message/data only).
The full JSON-RPC envelope (jsonrpc/id/error) is built by the
dispatcher or by to_jsonrpc_error above for non-dispatcher paths.
impl ToJsonRpcError for A2aError
Map A2aError onto turul-rpc’s JsonRpcErrorObject (code/message/data only).
The full JSON-RPC envelope (jsonrpc/id/error) is built by the
dispatcher or by to_jsonrpc_error above for non-dispatcher paths.
Source§fn to_error_object(&self) -> JsonRpcErrorObject
fn to_error_object(&self) -> JsonRpcErrorObject
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.