router: cli: print fatal errors including causes
as a first step of improving our error handling story, printing context and causes if the error contains them. The downside to adding context is that the default Display implementation will *just* print the context, which hides the root cause. This is why we print the errors using the pretty-print formatter in this change. Originally-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Gabriel Goller <g.goller@proxmox.com> [WB: prefix commit message with crate] Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
5295da1b8a
commit
8240e5022f
@ -83,7 +83,7 @@ async fn handle_simple_command_future(
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {}", err);
|
||||
eprintln!("Error: {err:?}");
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
@ -135,7 +135,7 @@ fn handle_simple_command(
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {}", err);
|
||||
eprintln!("Error: {err:?}");
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user