fn into_response()

in hfendpoints-http/src/error.rs [42:55]


    fn into_response(self) -> Response {
        let (status, body) = match self {
            Self::Endpoint(e) => (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()),
            Self::Io(e) => (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()),
            Self::Validation(e) => (StatusCode::BAD_REQUEST, e),
            Self::Multipart(e) => (StatusCode::BAD_REQUEST, e.to_string()),
            Self::NoResponse => (
                StatusCode::INTERNAL_SERVER_ERROR,
                String::from("No response returned by the inference engine"),
            ),
        };

        (status, body).into_response()
    }