fix: improve http client builder error message (#9380)

Include the lower-level error message in the generic error message.

No test because I can't actually make it fail by passing it bad PEM.
I checked and `reqwest::Certificate::from_pem()` always returns `Ok()`.

Fixes #9364.
This commit is contained in:
Ben Noordhuis 2021-02-03 11:40:43 +01:00 committed by GitHub
parent 3f6483e501
commit fb358380c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -28,7 +28,7 @@ pub fn create_http_client(
builder
.build()
.map_err(|_| generic_error("Unable to build http client"))
.map_err(|e| generic_error(format!("Unable to build http client: {}", e)))
}
#[cfg(test)]