logo

Struct actix_web::error::InternalError[][src]

pub struct InternalError<T> { /* fields omitted */ }
Expand description

Helper type that can wrap any error and generate custom response.

In following example any io::Error will be converted into “BAD REQUEST” response as opposite to INTERNAL SERVER ERROR which is defined by default.


fn index(req: Request) -> Result<&'static str> {
    Err(error::ErrorBadRequest(io::Error::new(io::ErrorKind::Other, "error")))
}

Implementations

Create InternalError instance

Create InternalError with predefined Response.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned.

The future response value.

Convert itself to AsyncResult or Error.

Override a status code for a Responder. Read more

Add header to the Responder’s response. Read more

Response’s status code Read more

Create response for error Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more