Trait actix_web::ResponseError[][src]

pub trait ResponseError: Debug + Display {
    fn status_code(&self) -> StatusCode { ... }
fn error_response(&self) -> Response<Body>
Notable traits for Response<Body>
impl Future for Response<Body> type Output = Result<Response<Body>, Error>;
{ ... } }
Expand description

Error that can be converted to Response

Provided methods

Response’s status code

Internal server error is generated by default.

Create response for error

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

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 returns PayloadTooLarge
  • 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