cli: more info displayed on error in garage stats

This commit is contained in:
Alex Auvolat 2022-12-13 15:46:04 +01:00
parent d6040e32a6
commit f8d5409894
No known key found for this signature in database
GPG key ID: 0E496D15096376BE

View file

@ -785,11 +785,12 @@ impl AdminRpcHandler {
match self match self
.endpoint .endpoint
.call(&node_id, AdminRpc::Stats(opt), PRIO_NORMAL) .call(&node_id, AdminRpc::Stats(opt), PRIO_NORMAL)
.await? .await
{ {
Ok(AdminRpc::Ok(s)) => writeln!(&mut ret, "{}", s).unwrap(), Ok(Ok(AdminRpc::Ok(s))) => writeln!(&mut ret, "{}", s).unwrap(),
Ok(x) => writeln!(&mut ret, "Bad answer: {:?}", x).unwrap(), Ok(Ok(x)) => writeln!(&mut ret, "Bad answer: {:?}", x).unwrap(),
Err(e) => writeln!(&mut ret, "Error: {}", e).unwrap(), Ok(Err(e)) => writeln!(&mut ret, "Remote error: {}", e).unwrap(),
Err(e) => writeln!(&mut ret, "Network error: {}", e).unwrap(),
} }
} }
Ok(AdminRpc::Ok(ret)) Ok(AdminRpc::Ok(ret))