//! Registry error types. use thiserror::Error; #[derive(Debug, Error)] pub enum RegistryError { #[error("http error: {0}")] Http(#[from] reqwest::Error), #[error("io error: {0}")] Io(#[from] std::io::Error), #[error("json error: {0}")] Json(#[from] serde_json::Error), #[error("no version of '{name}' satisfies '{req}'")] NoMatchingVersion { name: String, req: String }, #[error("package '{0}' not found in registry")] NotFound(String), #[error("checksum mismatch for '{name}': expected {expected}, got {actual}")] ChecksumMismatch { name: String, expected: String, actual: String, }, #[error("authentication required: provide an API key")] AuthRequired, #[error("registry returned error {status}: {message}")] RegistryError { status: u16, message: String }, #[error("manifest error: {0}")] Manifest(#[from] el_manifest::ManifestError), } pub type RegistryResult = Result;