pub enum ApiError {
InvalidBody(String),
BadJson(String),
PayloadTooLarge(String),
Unauthorized,
RateLimited {
retry_after_ms: u64,
},
Overloaded {
retry_after_ms: u64,
},
Engine(EngineError),
BadGateway(String),
Internal(String),
}Expand description
API transport and protocol errors.
Mapped to canonical HTTP status codes and JSON error envelopes matching the Python SDK taxonomy.
Variants§
InvalidBody(String)
Request failed validation or syntactic constraints (HTTP 422 Unprocessable Entity, invalid_body).
BadJson(String)
Payload contains malformed JSON syntax (HTTP 400 Bad Request, bad_json).
PayloadTooLarge(String)
Request payload exceeds maximum allowed size (HTTP 413 Payload Too Large, payload_too_large).
Missing or invalid Bearer authentication token (HTTP 401 Unauthorized, unauthorized).
RateLimited
Request exceeded rate limits (HTTP 429 Too Many Requests, rate_limited).
Overloaded
Server is temporarily overloaded (HTTP 529 API Overloaded, overloaded).
Engine(EngineError)
Error propagated from underlying decision engine dispatch.
BadGateway(String)
Upstream (proxied) service failed or was unreachable
(HTTP 502 Bad Gateway, bad_gateway).
Internal(String)
Unexpected internal server error (HTTP 500 Internal Server Error, internal_error).
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 From<EngineError> for ApiError
impl From<EngineError> for ApiError
Source§fn from(source: EngineError) -> Self
fn from(source: EngineError) -> Self
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> 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§
impl<T> Allocation for T
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
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> 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