#[non_exhaustive]pub enum ServerError {
Show 18 variants
TaskNotFound(TaskId),
TaskNotCancelable(TaskId),
InvalidParams(String),
InvalidField {
field: String,
message: String,
},
Serialization(Error),
Http(Error),
HttpClient(String),
Transport(String),
PushNotSupported,
Internal(String),
Config(String),
MethodNotFound(String),
Protocol(A2aError),
PayloadTooLarge(String),
UnsupportedOperation(String),
InvalidStateTransition {
task_id: TaskId,
from: TaskState,
to: TaskState,
},
Overloaded(String),
Halted(String),
}Expand description
Server framework error type.
Each variant maps to a specific A2A ErrorCode via to_a2a_error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TaskNotFound(TaskId)
The requested task was not found.
TaskNotCancelable(TaskId)
The task is in a terminal state and cannot be canceled.
InvalidParams(String)
Invalid method parameters.
InvalidField
Invalid method parameters, with the field at fault: answered as
InvalidParams carrying a google.rpc.BadRequest detail that names
the field (spec §3.3.2: well-known error types “SHOULD be used where
applicable”; audit register, the §3.3.2 row). The handler’s own
request checks named the field in the message only.
Fields
Serialization(Error)
JSON serialization/deserialization failure.
Http(Error)
Hyper HTTP error.
HttpClient(String)
HTTP client-side error (e.g. push notification delivery).
Transport(String)
Transport-layer error.
PushNotSupported
The agent does not support push notifications.
Internal(String)
An internal server error.
Config(String)
The handler cannot be built as configured: what
RequestHandlerBuilder::build refuses, saying what to change. A
mistake in the deploying code, never in a request, so no caller is
ever answered with it. Until 2026-10-30 these were InvalidParams,
which is also the -32602 a request is refused with (audit G-11).
MethodNotFound(String)
The requested JSON-RPC method was not found.
Protocol(A2aError)
An A2A protocol error propagated from the executor.
PayloadTooLarge(String)
The request body exceeds the configured size limit.
UnsupportedOperation(String)
The operation is not supported for the current task state (e.g. sending a message to a terminal task, subscribing to a completed task).
InvalidStateTransition
An invalid task state transition was attempted.
Fields
Overloaded(String)
The server is at a configured resource limit (e.g. the
max_concurrent_streams cap) and transiently cannot accept the request.
Clients should back off and retry. Maps to gRPC RESOURCE_EXHAUSTED.
Halted(String)
An operator halted the server, or the request’s tenant, with
RequestHandler::halt; new work is
refused until resume. Not
transient: retrying will not help until a person resumes it. HTTP
503, gRPC UNAVAILABLE, JSON-RPC internal error.
Implementations§
Source§impl ServerError
impl ServerError
Sourcepub const fn metric_label(&self) -> &'static str
pub const fn metric_label(&self) -> &'static str
Returns a bounded, low-cardinality discriminant for this error, suitable as a metrics/telemetry label.
This is a fixed set of variant names — never the error message, which embeds client-controlled data (task ids, sizes, URLs). Using the message as a metric label lets a caller mint an unbounded number of time series (e.g. by requesting many random task ids), exhausting the backend’s cardinality budget.
Sourcepub fn to_a2a_error(&self) -> A2aError
pub fn to_a2a_error(&self) -> A2aError
Converts this server error into an A2aError suitable for wire responses.
§Mapping
| Variant | ErrorCode |
|---|---|
TaskNotFound | TaskNotFound |
TaskNotCancelable | TaskNotCancelable |
InvalidParams | InvalidParams |
Serialization | ParseError |
MethodNotFound | MethodNotFound |
PushNotSupported | PushNotificationNotSupported |
UnsupportedOperation | UnsupportedOperation |
| everything else | InternalError |
Trait Implementations§
Source§impl Debug for ServerError
impl Debug for ServerError
Source§impl Display for ServerError
impl Display for ServerError
Source§impl Error for ServerError
impl Error for ServerError
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 ServerError
impl From<A2aError> for ServerError
Source§fn from(e: A2aError) -> ServerError
fn from(e: A2aError) -> ServerError
Source§impl From<Error> for ServerError
impl From<Error> for ServerError
Source§fn from(e: Error) -> ServerError
fn from(e: Error) -> ServerError
Source§impl From<Error> for ServerError
impl From<Error> for ServerError
Source§fn from(e: Error) -> ServerError
fn from(e: Error) -> ServerError
Auto Trait Implementations§
impl !RefUnwindSafe for ServerError
impl !UnwindSafe for ServerError
impl Forget for ServerError
impl Freeze for ServerError
impl Move for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnsafeUnpin for ServerError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].