cli_v2: error messages
All checks were successful
ci/woodpecker/push/debug Pipeline was successful
ci/woodpecker/pr/debug Pipeline was successful

This commit is contained in:
Alex 2025-01-30 16:17:35 +01:00
parent f8c6a8373d
commit ebc0e9319e

View file

@ -47,11 +47,11 @@ impl Cli {
AdminRpc::LaunchRepair(ro), AdminRpc::LaunchRepair(ro),
) )
.await .await
.ok_or_message("xoxo"), .ok_or_message("cli_v1"),
Command::Stats(so) => { Command::Stats(so) => {
cli_v1::cmd_admin(&self.admin_rpc_endpoint, self.rpc_host, AdminRpc::Stats(so)) cli_v1::cmd_admin(&self.admin_rpc_endpoint, self.rpc_host, AdminRpc::Stats(so))
.await .await
.ok_or_message("xoxo") .ok_or_message("cli_v1")
} }
Command::Worker(wo) => cli_v1::cmd_admin( Command::Worker(wo) => cli_v1::cmd_admin(
&self.admin_rpc_endpoint, &self.admin_rpc_endpoint,
@ -59,21 +59,21 @@ impl Cli {
AdminRpc::Worker(wo), AdminRpc::Worker(wo),
) )
.await .await
.ok_or_message("xoxo"), .ok_or_message("cli_v1"),
Command::Block(bo) => cli_v1::cmd_admin( Command::Block(bo) => cli_v1::cmd_admin(
&self.admin_rpc_endpoint, &self.admin_rpc_endpoint,
self.rpc_host, self.rpc_host,
AdminRpc::BlockOperation(bo), AdminRpc::BlockOperation(bo),
) )
.await .await
.ok_or_message("xoxo"), .ok_or_message("cli_v1"),
Command::Meta(mo) => cli_v1::cmd_admin( Command::Meta(mo) => cli_v1::cmd_admin(
&self.admin_rpc_endpoint, &self.admin_rpc_endpoint,
self.rpc_host, self.rpc_host,
AdminRpc::MetaOperation(mo), AdminRpc::MetaOperation(mo),
) )
.await .await
.ok_or_message("xoxo"), .ok_or_message("cli_v1"),
_ => unreachable!(), _ => unreachable!(),
} }
@ -91,7 +91,7 @@ impl Cli {
.admin_rpc_endpoint .admin_rpc_endpoint
.call(&self.rpc_host, AdminRpc::ApiRequest(req), PRIO_NORMAL) .call(&self.rpc_host, AdminRpc::ApiRequest(req), PRIO_NORMAL)
.await? .await?
.ok_or_message("xoxo")? .ok_or_message("rpc")?
{ {
AdminRpc::ApiOkResponse(resp) => <T as AdminApiEndpoint>::Response::try_from(resp) AdminRpc::ApiOkResponse(resp) => <T as AdminApiEndpoint>::Response::try_from(resp)
.map_err(|_| Error::Message(format!("{} returned unexpected response", req_name))), .map_err(|_| Error::Message(format!("{} returned unexpected response", req_name))),