Struct ajars_actix_web::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
pub fn respond_to(self, &HttpRequest) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn respond_to(self, &HttpRequest) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Notable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Convert self to HttpResponse
.
Override a status code for a Responder. Read more
Insert header to the final response. Read more
Returns appropriate status code for error. Read more
pub fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Notable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Creates full response for error. Read more