#[derive(Debug, thiserror::Error)]
pub enum InstallError {
#[error("plugin coords `{got}` invalid: {reason}")]
CoordsInvalid {
got: String,
reason: &'static str,
},
#[error("install http error: {0}")]
Http(String),
#[error("install io error: {0}")]
Io(String),
#[error("release `{owner}/{repo}` shape error: {reason}")]
ReleaseShape {
owner: String,
reason: String,
repo: String,
},
#[error(
"release for `{id}@{version}` has no tarball for target `{target}`. \
Available: {available:?}"
)]
TargetNotFound {
id: String,
version: semver::Version,
target: String,
available: Vec<String>,
},
#[error(
"release for `{id}` `.sha256` asset body `{got}` invalid: must be \
exactly 64 hex chars"
)]
Sha256Invalid {
id: String,
got: String,
},
#[error(
"sha256 mismatch for `{id}`: expected `{expected}`, got `{got}`. \
Tarball was tampered or the .sha256 asset is stale."
)]
Sha256Mismatch {
id: String,
expected: String,
got: String,
},
}