Skip to content

Commit 6277d7d

Browse files
committed
main: Report errors with 'error!()'
This was missed from cloud-hypervisor#7183, likely because `eprint!` is used instead of `eprintln!`. Signed-off-by: Bo Chen <[email protected]>
1 parent cea708d commit 6277d7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ pub fn cli_print_error_chain<'a>(
1919
&'a (dyn Error + 'static),
2020
) -> Option<String>,
2121
) {
22-
eprint!("Error: {component} exited with the following ");
22+
let msg = format!("Error: {component} exited with the following");
2323
if top_error.source().is_none() {
24-
error!("error:");
24+
error!("{msg} error:");
2525
error!(" {top_error}");
2626
} else {
27-
error!("chain of errors:");
27+
error!("{msg} chain of errors:");
2828
std::iter::successors(Some(top_error), |sub_error| {
2929
// Dereference necessary to mitigate rustc compiler bug.
3030
// See <https://github.com/rust-lang/rust/issues/141673>

0 commit comments

Comments
 (0)