mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 04:58:42 +00:00
Add new variant BinstallError::TaskJoinError
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ef72f851f7
commit
46cf20a3f7
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ use std::process::{ExitCode, Termination};
|
||||||
use log::{error, warn};
|
use log::{error, warn};
|
||||||
use miette::{Diagnostic, Report};
|
use miette::{Diagnostic, Report};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
use tokio::task;
|
||||||
|
|
||||||
/// Errors emitted by the library portion of cargo-binstall.
|
/// Errors emitted by the library portion of cargo-binstall.
|
||||||
#[derive(Error, Diagnostic, Debug)]
|
#[derive(Error, Diagnostic, Debug)]
|
||||||
|
@ -185,6 +186,10 @@ pub enum BinstallError {
|
||||||
help("Remove the `--manifest-path` or only specify one `$crate_name`")
|
help("Remove the `--manifest-path` or only specify one `$crate_name`")
|
||||||
)]
|
)]
|
||||||
ManifestPathConflictedWithBatchInstallation,
|
ManifestPathConflictedWithBatchInstallation,
|
||||||
|
|
||||||
|
#[error("Failed to join tokio::task::JoinHandle")]
|
||||||
|
#[diagnostic(severity(error), code(binstall::join_error))]
|
||||||
|
TaskJoinError(#[from] task::JoinError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BinstallError {
|
impl BinstallError {
|
||||||
|
@ -213,6 +218,7 @@ impl BinstallError {
|
||||||
VersionUnavailable { .. } => 83,
|
VersionUnavailable { .. } => 83,
|
||||||
DuplicateVersionReq => 84,
|
DuplicateVersionReq => 84,
|
||||||
ManifestPathConflictedWithBatchInstallation => 85,
|
ManifestPathConflictedWithBatchInstallation => 85,
|
||||||
|
TaskJoinError(_) => 17,
|
||||||
};
|
};
|
||||||
|
|
||||||
// reserved codes
|
// reserved codes
|
||||||
|
|
Loading…
Add table
Reference in a new issue