mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-29 04:25:40 +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:
@@ -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> {
|
||||
|
Reference in New Issue
Block a user