1
0
mirror of https://github.com/containers/youki synced 2024-11-23 09:21:57 +01:00

Merge pull request #1302 from YJDoc2/log_final_result

Log result of the command before returning from main
This commit is contained in:
Toru Komatsu 2022-10-25 21:28:17 +09:00 committed by GitHub
commit 1c32af7d29
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -97,7 +97,7 @@ fn main() -> Result<()> {
let root_path = determine_root_path(opts.global.root)?;
let systemd_cgroup = opts.global.systemd_cgroup;
match opts.subcmd {
let cmd_result = match opts.subcmd {
SubCommand::Standard(cmd) => match cmd {
StandardCmd::Create(create) => {
commands::create::create(create, root_path, systemd_cgroup)
@ -132,7 +132,12 @@ fn main() -> Result<()> {
SubCommand::Completion(completion) => {
commands::completion::completion(completion, &mut app)
}
};
if let Err(ref e) = cmd_result {
log::error!("error in executing command: {:?}", e);
}
cmd_result
}
fn determine_root_path(root_path: Option<PathBuf>) -> Result<PathBuf> {