/// Make an http request to Omaha, and collect the response into an error or a blob of bytes
/// that can be parsed.
///
/// Given the http client and the request build, this makes the http request, and then coalesces
/// the various errors into a single error type for easier error handling by the make process
/// flow.
///
/// This function also converts an HTTP error response into an Error, to divert those into the
/// error handling paths instead of the Ok() path.
Make an http request to Omaha, and collect the response into an error or a blob of bytes
that can be parsed.

Given the http client and the request build, this makes the http request, and then coalesces
the various errors into a single error type for easier error handling by the make process
flow.

This function also converts an HTTP error response into an Error, to divert those into the
error handling paths instead of the Ok() path.
Make an http request to Omaha and collect the response into an error or a blob of bytes that can be parsed . Given the http client and the request build this makes the http request and then coalesces the various errors into a single error type for easier error handling by the make process flow . This function also converts an HTTP error response into an Error to divert those into the error handling paths instead of the Ok () path .
async fn do_omaha_request<'a>(
        http: &'a mut HR,
        builder: RequestBuilder<'a>,
    ) -> Result<(Parts, Vec<u8>), OmahaRequestError> {
        let (parts, body) = await!(Self::make_request(http, builder.build()?))?;
        if !parts.status.is_success() {
            // Convert HTTP failure responses into Errors.
            Err(OmahaRequestError::HttpStatus(parts.status))
        } else {
            // Pass successful responses to the caller.
            info!("Omaha HTTP response: {}", parts.status);
            Ok((parts, body))
        }
    }
async fn do_omaha_request < ' a > ( http : & ' a mut HR , builder : RequestBuilder < ' a > , ) -> Result < ( Parts , Vec < u8 > ) , OmahaRequestError > { let ( parts , body ) = await ! ( Self make_request ( http builder build ( ) ) ) ? ; if ! parts . status . is_success ( ) { // Convert HTTP failure responses into Errors. Err ( OmahaRequestError :: HttpStatus ( parts . status ) ) } else { // Pass successful responses to the caller. info ! ( " " parts status ) ; Ok ( ( parts , body ) ) } }
Make an http request to Omaha, and collect the response into an error or a blob of bytes
that can be parsed.
Make an http request to Omaha and collect the response into an error or a blob of bytes that can be parsed .
http
&'a mut HR
builder
RequestBuilder<'a>