#[non_exhaustive]pub enum ApiError {
InvalidRequest(String),
Unauthenticated(String),
AlreadyExists(String),
Conflict(ApiConflict),
TaskNotFound(String),
NotFound(String),
MethodNotAllowed(String),
UnsupportedMediaType(String),
PayloadTooLarge(String),
ResourceVersionExpired(String),
Unavailable(String),
Internal(String),
}Expand description
Error returned by the handler or a transport boundary.
| Variant | HTTP | gRPC |
|---|---|---|
InvalidRequest | 400 | InvalidArgument |
Unauthenticated | 401 | Unauthenticated |
AlreadyExists | 409 | AlreadyExists |
Conflict | 409 | Aborted |
TaskNotFound, NotFound | 404 | NotFound |
MethodNotAllowed | 405 | Unimplemented |
UnsupportedMediaType | 415 | InvalidArgument |
PayloadTooLarge | 413 | ResourceExhausted |
ResourceVersionExpired | 410 | OutOfRange |
Unavailable | 503 | Unavailable |
Internal | 500 | Internal |
This enum is non-exhaustive. Match it with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRequest(String)
The request is syntactically or semantically invalid.
Unauthenticated(String)
The bearer credential is missing, malformed, or rejected.
AlreadyExists(String)
A retained task already owns the requested name.
Conflict(ApiConflict)
A write precondition does not match the current task.
TaskNotFound(String)
No public task has the requested name.
NotFound(String)
No public resource or route matches the request.
MethodNotAllowed(String)
The resource does not support the requested method.
UnsupportedMediaType(String)
The request media type is missing or unsupported.
PayloadTooLarge(String)
The request body or message exceeds the configured limit.
ResourceVersionExpired(String)
The requested list snapshot or watch position is no longer retained.
The service cannot currently accept work.
Internal(String)
An unexpected server-side failure occurred.
Implementations§
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
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 IntoResponse for ApiError
Available on crate feature http only.
impl IntoResponse for ApiError
http only.Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Source§impl OperationOutput for ApiError
impl OperationOutput for ApiError
Source§fn operation_response(
context: &mut GenContext,
_operation: &mut Operation,
) -> Option<ApiResponse>
fn operation_response( context: &mut GenContext, _operation: &mut Operation, ) -> Option<ApiResponse>
Source§fn inferred_responses(
ctx: &mut GenContext,
operation: &mut Operation,
) -> Vec<(Option<StatusCode>, Response)>
fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<StatusCode>, Response)>
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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>
impl<T> IntoApiResponse for Twhere
T: IntoResponse + OperationOutput,
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