Skip to content

Commit

Permalink
Show response code in API client error message (#2683)
Browse files Browse the repository at this point in the history
It's hard to investigate what happens when an API client error is
printed out
  • Loading branch information
hashmap authored Mar 23, 2019
1 parent 73a46c6 commit 3566da2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
.and_then(|resp| {
if !resp.status().is_success() {
Either::A(err(ErrorKind::RequestError(
"Wrong response code".to_owned(),
)
Either::A(err(ErrorKind::RequestError(format!(
"Wrong response code: {}",
resp.status()
))
.into()))
} else {
Either::B(
Expand Down

0 comments on commit 3566da2

Please sign in to comment.