mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
tools: Simplify error handling in agent-ctl
Don't format the error string before passing to the `anyhow!()` macro since it can format strings itself. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
ad7dce47ca
commit
7be95b15eb
@ -247,7 +247,7 @@ fn get_agent_cmd_func(name: &str) -> Result<AgentCmdFp> {
|
||||
}
|
||||
}
|
||||
|
||||
Err(anyhow!(format!("Invalid command: {:?}", name)))
|
||||
Err(anyhow!("Invalid command: {:?}", name))
|
||||
}
|
||||
|
||||
fn get_builtin_cmd_details() -> Vec<String> {
|
||||
@ -275,7 +275,7 @@ fn get_builtin_cmd_func(name: &str) -> Result<BuiltinCmdFp> {
|
||||
}
|
||||
}
|
||||
|
||||
Err(anyhow!(format!("Invalid command: {:?}", name)))
|
||||
Err(anyhow!("Invalid command: {:?}", name))
|
||||
}
|
||||
|
||||
fn client_create_vsock_fd(cid: libc::c_uint, port: u32) -> Result<RawFd> {
|
||||
|
Loading…
Reference in New Issue
Block a user