mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 11:40:04 +00:00
Don’t print "Fatal error" for UserAbort
This commit is contained in:
parent
d21c4a0875
commit
7f0c818313
2 changed files with 3 additions and 5 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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:?}");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue