pub enum ApiError {
BadRequest(String),
NotFound(String),
Conflict(String),
Internal(String),
}Expand description
Per-request error mapped to an HTTP status + JSON body { "error": "…" }.
Variants§
BadRequest(String)
400 — malformed request, missing project header, or validation failure.
NotFound(String)
404 — referenced entity does not exist.
Conflict(String)
409 — lifecycle conflict (duplicate open / already closed).
Internal(String)
500 — store or other internal failure.
Trait Implementations§
Source§impl From<ServiceError> for ApiError
impl From<ServiceError> for ApiError
Source§fn from(err: ServiceError) -> Self
fn from(err: ServiceError) -> Self
Converts to this type from the input type.
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a 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
Mutably borrows from an owned value. Read more