From 6277d7d5f20126945904fefdf5fb990bbcce5ae8 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Wed, 16 Jul 2025 22:27:05 +0000 Subject: [PATCH] main: Report errors with 'error!()' This was missed from #7183, likely because `eprint!` is used instead of `eprintln!`. Signed-off-by: Bo Chen --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 355f0a9cf..b8065083d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,12 +19,12 @@ pub fn cli_print_error_chain<'a>( &'a (dyn Error + 'static), ) -> Option, ) { - eprint!("Error: {component} exited with the following "); + let msg = format!("Error: {component} exited with the following"); if top_error.source().is_none() { - error!("error:"); + error!("{msg} error:"); error!(" {top_error}"); } else { - error!("chain of errors:"); + error!("{msg} chain of errors:"); std::iter::successors(Some(top_error), |sub_error| { // Dereference necessary to mitigate rustc compiler bug. // See