Don’t print "Fatal error" for UserAbort

This commit is contained in:
Félix Saparelli 2022-05-31 23:16:55 +12:00
parent d21c4a0875
commit 7f0c818313
No known key found for this signature in database
GPG key ID: B948C4BAE44FC474
2 changed files with 3 additions and 5 deletions

View file

@ -1,6 +1,6 @@
use std::process::{ExitCode, Termination}; use std::process::{ExitCode, Termination};
use log::warn; use log::{error, warn};
use miette::{Diagnostic, Report}; use miette::{Diagnostic, Report};
use thiserror::Error; use thiserror::Error;
@ -189,6 +189,7 @@ impl Termination for BinstallError {
if let BinstallError::UserAbort = self { if let BinstallError::UserAbort = self {
warn!("Installation cancelled"); warn!("Installation cancelled");
} else { } else {
error!("Fatal error:");
eprintln!("{:?}", Report::new(self)); eprintln!("{:?}", Report::new(self));
} }

View file

@ -93,10 +93,7 @@ impl Termination for MainExit {
info!("Installation completed in {spent:?}"); info!("Installation completed in {spent:?}");
ExitCode::SUCCESS ExitCode::SUCCESS
} }
Self::Error(err) => { Self::Error(err) => err.report(),
error!("Fatal error:");
err.report()
}
Self::Report(err) => { Self::Report(err) => {
error!("Fatal error:"); error!("Fatal error:");
eprintln!("{err:?}"); eprintln!("{err:?}");