# actix_web::error::ResponseError - Rust
API documentation for the Rust `ResponseError` trait in crate `actix_web`.
Keywords: rust, rustlang, rust-lang, ResponseError

# Trait actix_web::error::ResponseError [−] [src]

    pub trait ResponseError: Fail + InternalResponseErrorAsFail {
        fn error_response(&self) -> HttpResponse { ... }
    }

Error that can be converted to `HttpResponse`

## Provided Methods

### `fn error_response(&self) -> HttpResponse`

Create response for error

Internal server error is generated by default.

## Implementations on Foreign Types

###

`impl<T> ResponseError for Compat<T> where T: Display + Debug + Sync + Send + 'static,`

[src]

Compatibility for `failure::Error`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for JsonError`

[src]

`InternalServerError` for `JsonError`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for TimerError`

[src]

`InternalServerError` for `TimerError`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for DeError`

[src]

Return `BAD_REQUEST` for `de::value::Error`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for Utf8Error`

[src]

Return `BAD_REQUEST` for `Utf8Error`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for HttpError`

[src]

Return `InternalServerError` for `HttpError`, Response generation can return `HttpError`, so it is internal error

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for Error`

[src]

Return `InternalServerError` for `io::Error`

####

`fn error_response(&self) -> HttpResponse`

[src]

###

`impl ResponseError for Canceled`

[src]

`InternalServerError` for `futures::Canceled`

####

`fn error_response(&self) -> HttpResponse`

[src]

## Implementors

- `impl ResponseError for SendRequestError` | [src]

- `impl ResponseError for UrlParseError` | [src]

- `impl ResponseError for InvalidHeaderValue` | [src]

- `impl ResponseError for InvalidHeaderValueBytes` | [src]

- `impl ResponseError for MailboxError` | [src]

- `impl ResponseError for actix_web::error::ParseError` | [src]

- `impl ResponseError for PayloadError` | [src]

- `impl ResponseError for actix_web::error::CookieParseError` | [src]

- `impl ResponseError for MultipartError` | [src]

- `impl ResponseError for ExpectError` | [src]

- `impl ResponseError for ContentTypeError` | [src]

- `impl ResponseError for UrlencodedError` | [src]

- `impl ResponseError for JsonPayloadError` | [src]

- `impl ResponseError for UriSegmentError` | [src]

- `impl ResponseError for UrlGenerationError` | [src]

- `impl ResponseError for StaticFileError` | [src]

- `impl<T> ResponseError for InternalError<T> where T: Send + Sync + Debug + Display + 'static,` | [src]

- `impl ResponseError for CorsError` | [src]

- `impl ResponseError for CsrfError` | [src]

- `impl ResponseError for CookieSessionError` | [src]

- `impl ResponseError for ProtocolError` | [src]

- `impl ResponseError for HandshakeError` | [src]

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)