From ea9c85fb94975399f7d69bbbc5db379cfc529379 Mon Sep 17 00:00:00 2001 From: WillLillis Date: Sat, 11 Jan 2025 17:48:35 -0500 Subject: [PATCH] fix(cli): fix error display, considering structured data returned from generate command --- cli/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 988c1bb9..a46b6894 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -748,7 +748,8 @@ impl Generate { // Exit early to prevent errors from being printed a second time in the caller std::process::exit(1); } else { - return Err(err.into()); + // Removes extra context associated with the error + Err(anyhow!(err.to_string()))?; } } if self.build { @@ -1640,7 +1641,7 @@ fn main() { } } if !err.to_string().is_empty() { - eprintln!("{err}"); + eprintln!("{err:?}"); } std::process::exit(1); }