mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
main: Report errors with 'error!()'
This was missed from #7183, likely because `eprint!` is used instead of `eprintln!`. Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -19,12 +19,12 @@ pub fn cli_print_error_chain<'a>(
|
|||||||
&'a (dyn Error + 'static),
|
&'a (dyn Error + 'static),
|
||||||
) -> Option<String>,
|
) -> Option<String>,
|
||||||
) {
|
) {
|
||||||
eprint!("Error: {component} exited with the following ");
|
let msg = format!("Error: {component} exited with the following");
|
||||||
if top_error.source().is_none() {
|
if top_error.source().is_none() {
|
||||||
error!("error:");
|
error!("{msg} error:");
|
||||||
error!(" {top_error}");
|
error!(" {top_error}");
|
||||||
} else {
|
} else {
|
||||||
error!("chain of errors:");
|
error!("{msg} chain of errors:");
|
||||||
std::iter::successors(Some(top_error), |sub_error| {
|
std::iter::successors(Some(top_error), |sub_error| {
|
||||||
// Dereference necessary to mitigate rustc compiler bug.
|
// Dereference necessary to mitigate rustc compiler bug.
|
||||||
// See <https://github.com/rust-lang/rust/issues/141673>
|
// See <https://github.com/rust-lang/rust/issues/141673>
|
||||||
|
|||||||
Reference in New Issue
Block a user