Trait actix_web::ResponseError [−][src]
pub trait ResponseError: Debug + Display {
fn status_code(&self) -> StatusCode { ... }
fn error_response(&self) -> Response<Body>ⓘ { ... }
}
Expand description
Error that can be converted to Response
Provided methods
fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Response’s status code
Internal server error is generated by default.
Implementations
Downcasts generic body to a specific type.
Downcasts a generic body to a mutable specific type.
Implementations on Foreign Types
Return BAD_REQUEST
for de::value::Error
InternalServerError
for JsonError
impl<E, U, I> ResponseError for DispatcherError<E, U, I> where
U: Encoder<I> + Decoder,
E: Debug + Display,
<U as Encoder<I>>::Error: Debug,
<U as Decoder>::Error: Debug,
Return BAD_REQUEST
for Utf8Error
InternalServerError
for FormError
Return GATEWAY_TIMEOUT
for TimeoutError
Return InternalServerError
for io::Error
Implementors
Return InternalServerError
for JsonPayloadError
PayloadError
returns two possible results:
Overflow
returnsPayloadTooLarge
- Other errors returns
BadRequest
Convert SendRequestError
to a server Response
Return BadRequest
for ContentTypeError
Return BadRequest
for cookie::ParseError
Return BadRequest
for JsonPayloadError
Return BadRequest
for ParseError
Return BadRequest
for PathError
Return BadRequest
for QueryPayloadError
Return BadRequest
for ReadlinesError
InternalServerError
for UrlGeneratorError
Return BadRequest
for UrlencodedError
BadRequest
for InvalidHeaderValue
Return InternalServerError
for HttpError
,
Response generation can return HttpError
, so it is internal error
InternalServerError
for Canceled
InternalServerError
for BlockingError