Struct actix_web::error::InternalError [−][src]
pub struct InternalError<T> { /* fields omitted */ }
Expand description
Wraps errors to alter the generated response status code.
In following example, the io::Error
is wrapped into ErrorBadRequest
which will generate a
response with the 400 Bad Request status code instead of the usual status code generated by
an io::Error
.
Examples
async fn handler_error() -> Result<String, actix_web::Error> {
let err = io::Error::new(io::ErrorKind::Other, "error");
Err(error::ErrorBadRequest(err))
}
Implementations
Constructs an InternalError
with given status code.
Constructs an InternalError
with pre-defined response.
Trait Implementations
fn respond_to(self, _: &HttpRequest) -> HttpResponse<Self::Body>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
fn respond_to(self, _: &HttpRequest) -> HttpResponse<Self::Body>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
Convert self to HttpResponse
.
Wraps responder to allow alteration of its response. Read more
Returns appropriate status code for error. Read more
fn error_response(&self) -> HttpResponseⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
fn error_response(&self) -> HttpResponseⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
Creates full response for error. 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
pub fn vzip(self) -> V
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