diff --git a/crates/icepick/src/cli/mod.rs b/crates/icepick/src/cli/mod.rs index 57f5330..d59903e 100644 --- a/crates/icepick/src/cli/mod.rs +++ b/crates/icepick/src/cli/mod.rs @@ -122,7 +122,10 @@ pub fn do_cli_thing() { }); let config_path = config_file.unwrap_or_else(|| "icepick.toml".to_string()); let config_content = std::fs::read_to_string(config_path).expect("can't read config file"); - let mut config: Config = toml::from_str(&config_content).expect("config file had invalid toml"); + let mut config: Config = match toml::from_str(&config_content) { + Ok(config) => config, + Err(e) => panic!("Error while loading TOML config: {e}"), + }; config.modules.push(ModuleConfig { name: "internal".to_string(), command_name: Default::default(), diff --git a/crates/icepick/src/cli/workflow.rs b/crates/icepick/src/cli/workflow.rs index 8a79e80..1974a7e 100644 --- a/crates/icepick/src/cli/workflow.rs +++ b/crates/icepick/src/cli/workflow.rs @@ -87,7 +87,7 @@ impl InvocableOperation { let result = child.wait_with_output().unwrap(); if !result.status.success() { - panic!("Bad exit: {}", String::from_utf8_lossy(&result.stderr)); + panic!("Bad exit ({}: {}): {}", &self.binary, &self.operation.name, String::from_utf8_lossy(&result.stderr)); } let output = result.stdout; @@ -133,7 +133,7 @@ impl Workflow { } } } - panic!("Key was not found: {input}"); + panic!("Required workflow input was not found: {input}"); } map