alexyin1 commented on code in PR #489: URL: https://github.com/apache/iceberg-rust/pull/489#discussion_r1697495594
########## crates/test_utils/src/cmd.rs: ########## @@ -28,14 +28,27 @@ pub fn run_command(mut cmd: Command, desc: impl ToString) { } } -pub fn get_cmd_output(mut cmd: Command, desc: impl ToString) -> String { +pub fn get_cmd_output_result(mut cmd: Command, desc: impl ToString) -> Result<String, String> { let desc = desc.to_string(); log::info!("Starting to {}, command: {:?}", &desc, cmd); - let output = cmd.output().unwrap(); - if output.status.success() { - log::info!("{} succeed!", desc); - String::from_utf8(output.stdout).unwrap() - } else { - panic!("{} failed: {:?}", desc, output.status); + let result = cmd.output(); + match result { + Ok(output) => { + if output.status.success() { + log::info!("{} succeed!", desc); + Ok(String::from_utf8(output.stdout).unwrap()) + } else { + Err(format!("{} failed with rc: {:?}", desc, output.status)) + } + } + Err(_err) => Err(format!("{} failed to execute", desc)), Review Comment: Fixed, https://github.com/apache/iceberg-rust/commit/19901bac9256f06c28da78a3107157740f21a24a sample output: ``` cmd failed with error: No such file or directory (os error 2) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org