mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
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:
parent
73a46c6190
commit
3566da2434
1 changed files with 4 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue