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
Convert itself to AsyncResult
or Error
.
Override a status code for a Responder. Read more
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
Self: Sized,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
Self: Sized,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
Add header to the Responder’s response. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for InternalError<T>
impl<T> !Send for InternalError<T>
impl<T> !Sync for InternalError<T>
impl<T> Unpin for InternalError<T> where
T: Unpin,
impl<T> !UnwindSafe for InternalError<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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