From 79fce53b22372427ab575c990fd7e5dee0b0e8fa Mon Sep 17 00:00:00 2001 From: Duane Johnson Date: Thu, 6 Mar 2025 17:41:44 -0700 Subject: [PATCH] Fix print full error messages When an error is raised, rather than printing the Rust enum short form (e.g. "NoWerkfile"), print the more descriptive error message (e.g. "Werkfile not found in this directory or any parent directory"). --- werk-cli/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/werk-cli/main.rs b/werk-cli/main.rs index 610007c4..df1843c0 100644 --- a/werk-cli/main.rs +++ b/werk-cli/main.rs @@ -187,7 +187,11 @@ fn main() -> Result<(), Error> { .init(), } - smol::block_on(try_main(args)) + if let Err(e) = smol::block_on(try_main(args)) { + eprintln!("Error: {}", e); + std::process::exit(1); + } + Ok(()) } async fn try_main(args: Args) -> Result<(), Error> {