Show response code in API client error message (#2683)

It's hard to investigate what happens when an API client error is
printed out
This commit is contained in:
hashmap 2019-03-23 22:24:45 +01:00 committed by GitHub
parent 73a46c6190
commit 3566da2434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,9 +202,10 @@ fn send_request_async(req: Request<Body>) -> Box<dyn Future<Item = String, Error
.map_err(|e| ErrorKind::RequestError(format!("Cannot make request: {}", e)).into()) .map_err(|e| ErrorKind::RequestError(format!("Cannot make request: {}", e)).into())
.and_then(|resp| { .and_then(|resp| {
if !resp.status().is_success() { if !resp.status().is_success() {
Either::A(err(ErrorKind::RequestError( Either::A(err(ErrorKind::RequestError(format!(
"Wrong response code".to_owned(), "Wrong response code: {}",
) resp.status()
))
.into())) .into()))
} else { } else {
Either::B( Either::B(