Enum minerva_rest::controller::response::ErrorResponse
source · [−]pub enum ErrorResponse {
Show 13 variants
BadRequest(String),
Unauthorized(String),
NotFound(String),
RequestTimeout(String),
Conflict(String),
PreconditionFailed(String),
UnprocessableEntity(String),
NoResponse(String),
ClientClosedRequest(String),
InternalServerError(String),
NotImplemented(String),
ServiceUnavailable(String),
NetworkAuthenticationRequired(String),
}
Expand description
Enumeration containing many kinds of error responses to a REST request that was received. All of these responses should contain an embedded JSON in String format. These error responses are modelled after HTTP response codes.
Variants
BadRequest(String)
400 Bad Request
Unauthorized(String)
401 Unauthorized
NotFound(String)
404 Not Found
RequestTimeout(String)
408 Request Timeout
Conflict(String)
409 Conflict
PreconditionFailed(String)
412 Precondition Failed
UnprocessableEntity(String)
422 Unprocessable Entity
NoResponse(String)
444 No Response
ClientClosedRequest(String)
499 Client Closed Request
InternalServerError(String)
500 Internal Server Error
NotImplemented(String)
501 Not Implemented
ServiceUnavailable(String)
503 Service Unavailable
NetworkAuthenticationRequired(String)
511 Network Authentication Required
Implementations
sourceimpl ErrorResponse
impl ErrorResponse
sourcefn convert(status: Status) -> Self
fn convert(status: Status) -> Self
Actual internal conversion function for generating an error Response
from a gRPC Status
. The Status
message will be converted into a JSON
object containing a single "message"
field, which will be the response
body.
Panics
This function will panic if using an unhandled status code or if the
status code is “Ok
”, in which case it should have been a successful
response instead.
Trait Implementations
sourceimpl Clone for ErrorResponse
impl Clone for ErrorResponse
sourcefn clone(&self) -> ErrorResponse
fn clone(&self) -> ErrorResponse
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ErrorResponse
impl Debug for ErrorResponse
sourceimpl From<ErrorResponse> for Message
impl From<ErrorResponse> for Message
sourcefn from(response: ErrorResponse) -> Self
fn from(response: ErrorResponse) -> Self
sourceimpl From<Status> for ErrorResponse
impl From<Status> for ErrorResponse
sourceimpl OpenApiResponderInner for ErrorResponse
impl OpenApiResponderInner for ErrorResponse
sourceimpl<'r, 'o: 'r> Responder<'r, 'o> for ErrorResponse
impl<'r, 'o: 'r> Responder<'r, 'o> for ErrorResponse
sourcefn respond_to(self, __req: &'r Request<'_>) -> Result<'o>
fn respond_to(self, __req: &'r Request<'_>) -> Result<'o>
Ok
if a Response
could be generated successfully. Otherwise,
returns an Err
with a failing Status
. Read moreAuto Trait Implementations
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnwindSafe for ErrorResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
self
into a collection.fn mapped<U, F, A>(self, f: F) -> SmallVec<A>where
F: FnMut(T) -> U,
A: Array<Item = U>,
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request