pub struct ApiError { /* private fields */ }Expand description
Uniform error response type for the handlers in this module. Converts to
a JSON {"error": message} body with the given status via IntoResponse.
Implementations§
Source§impl ApiError
impl ApiError
Sourcepub fn engine(e: impl Display) -> Self
pub fn engine(e: impl Display) -> Self
Wraps an engine-side error as 500 Internal Server Error.
Sourcepub fn bad_request(m: String) -> Self
pub fn bad_request(m: String) -> Self
Builds a 400 Bad Request with the given message.
Sourcepub fn conflict(m: String) -> Self
pub fn conflict(m: String) -> Self
Builds a 409 Conflict with the given message (POST /v1/runs/:id/resume — the Run is not Interrupted, or a concurrent
resume already won the Interrupted -> Running compare-and-set).
Builds a 503 Service Unavailable with the given message (GH #33
Guard 1 — operator readiness precheck).
Sourcepub fn timeout(m: String) -> Self
pub fn timeout(m: String) -> Self
Builds a 504 Gateway Timeout with the given message (GH #33
Guard 2 — sync launch timeout ceiling).
Sourcepub fn gone(m: String) -> Self
pub fn gone(m: String) -> Self
Builds a 410 Gone with the given message (GH #37 — worker
submit/artifact addressed at a Run that already reached a terminal
status; the silent-204-then-orphan alternative is the failure
shape this replaces).
Sourcepub fn payload_too_large(m: String) -> Self
pub fn payload_too_large(m: String) -> Self
Builds a 413 Payload Too Large with the given message (GH #42 —
@file: sentinel resolves to a file larger than the shared
DefaultBodyLimit; same size ceiling as the inline body path).
Sourcepub fn unprocessable(m: impl Into<String>) -> Self
pub fn unprocessable(m: impl Into<String>) -> Self
Builds a 422 Unprocessable Entity with the given message (GH #50
— a worker_submit / worker_artifact value violates the
dispatching agent’s declared VerdictContract: rejected before it
reaches submit_worker_result_trusted / stage_worker_artifact_trusted,
i.e. before it can land in the flow ctx).
Trait Implementations§
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§
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> 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