Make tests capture the error printed by a Result return
This commit is contained in:
parent
43c22af267
commit
293f662ca9
3 changed files with 24 additions and 9 deletions
|
@ -2200,9 +2200,7 @@ impl<T: Termination, E: fmt::Debug> Termination for Result<T, E> {
|
|||
match self {
|
||||
Ok(val) => val.report(),
|
||||
Err(err) => {
|
||||
// Ignore error if the write fails, for example because stderr is
|
||||
// already closed. There is not much point panicking at this point.
|
||||
let _ = writeln!(io::stderr(), "Error: {err:?}");
|
||||
io::attempt_print_to_stderr(format_args_nl!("Error: {err:?}"));
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue