1use crate::install::provider::InstallProviderId;
4use crate::records::format_bytes;
5
6#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
8pub enum InstallError {
9 #[error("No install provider is registered as {0}.")]
11 ProviderUnknown(InstallProviderId),
12 #[error("{0}")]
14 ProviderUnavailable(String),
15 #[error("{0} is not a reference this provider understands.")]
17 ReferenceInvalid(String),
18 #[error("{0} was not found on the platform.")]
20 ReferenceNotFound(String),
21 #[error(
23 "{0} is gated. Add a Hugging Face access token, or sign in with `huggingface-cli login`."
24 )]
25 AuthRequired(String),
26 #[error(
28 "Not enough free disk space: this model needs {} and {} is available.",
29 format_bytes(*required_bytes),
30 format_bytes(*available_bytes)
31 )]
32 InsufficientDisk {
33 required_bytes: i64,
35 available_bytes: i64,
37 },
38 #[error("{0} failed checksum verification after download.")]
40 ChecksumMismatch(String),
41 #[error("{0}")]
43 TransferFailed(String),
44}