pub struct ApiError {
pub status: StatusCode,
pub message: String,
pub code: Option<ApiErrorCode>,
}Fields§
§status: StatusCode§message: String§code: Option<ApiErrorCode>Implementations§
Source§impl ApiError
impl ApiError
pub fn not_found(message: impl Into<String>) -> Self
pub fn bad_request(message: impl Into<String>) -> Self
pub fn conflict(message: impl Into<String>) -> Self
Authentication failed or was not presented (the webhook HMAC).
Sourcepub fn forbidden(message: impl Into<String>) -> Self
pub fn forbidden(message: impl Into<String>) -> Self
Authenticated or not, this route refuses the request (webhook for the wrong repository, or hooks not configured — refused closed).
pub fn internal(message: impl Into<String>) -> Self
Sourcepub fn unprocessable(message: impl Into<String>) -> Self
pub fn unprocessable(message: impl Into<String>) -> Self
A gated merge whose gate suite failed — the request was well-formed but the mission’s state is not mergeable yet.
pub fn with_code(self, code: ApiErrorCode) -> Self
Trait Implementations§
Source§impl From<EngineError> for ApiError
impl From<EngineError> for ApiError
Source§fn from(error: EngineError) -> Self
fn from(error: EngineError) -> 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