pub enum Error {
UnsupportedPlatform {
os: String,
arch: String,
},
UnknownPlatformSlug(String),
Io {
context: String,
source: Error,
},
Http(Error),
HttpStatus {
url: String,
status: u16,
},
CurlFailed {
url: String,
code: i32,
},
ChecksumMismatch {
expected: String,
actual: String,
},
TomlParse(Error),
Zip(ZipError),
HyperdNotInArchive,
ScrapeFailed(&'static str),
}Expand description
Errors produced while downloading, verifying, and installing hyperd.
Every fallible function in this crate returns a Result<T, Error>. The
variants line up with the phases of bootstrap: platform detection,
HTTP/curl fetching, TOML parsing, archive extraction, and checksum
verification.
Variants§
UnsupportedPlatform
The host (os / arch combination) has no published hyperd build.
Fields
UnknownPlatformSlug(String)
A platform slug (e.g. "macos-arm64") did not match any known target.
Io
A filesystem or I/O operation failed, enriched with contextual text.
Fields
Http(Error)
A reqwest HTTP client error (connection failure, TLS issue, etc.).
HttpStatus
A server returned a non-success HTTP status while fetching url.
Fields
CurlFailed
The fallback curl subprocess exited with a non-zero status.
ChecksumMismatch
The downloaded archive did not match the expected SHA-256 checksum.
Fields
TomlParse(Error)
The hyperd-version.toml file could not be parsed.
Zip(ZipError)
The downloaded ZIP archive was malformed or could not be extracted.
HyperdNotInArchive
The archive did not contain a recognizable hyperd executable.
ScrapeFailed(&'static str)
Scraping the public releases page for the latest version failed.
Implementations§
Source§impl Error
impl Error
Sourcepub fn unsupported_platform(
os: impl Into<String>,
arch: impl Into<String>,
) -> Self
pub fn unsupported_platform( os: impl Into<String>, arch: impl Into<String>, ) -> Self
Constructs an Self::UnsupportedPlatform error.
Sourcepub fn unknown_platform_slug(slug: impl Into<String>) -> Self
pub fn unknown_platform_slug(slug: impl Into<String>) -> Self
Constructs an Self::UnknownPlatformSlug error.
Sourcepub fn http_status(url: impl Into<String>, status: u16) -> Self
pub fn http_status(url: impl Into<String>, status: u16) -> Self
Constructs an Self::HttpStatus error.
Sourcepub fn curl_failed(url: impl Into<String>, code: i32) -> Self
pub fn curl_failed(url: impl Into<String>, code: i32) -> Self
Constructs an Self::CurlFailed error.
Sourcepub fn checksum_mismatch(
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn checksum_mismatch( expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Constructs an Self::ChecksumMismatch error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()