Skip to main content

AssetError

Enum AssetError 

Source
#[non_exhaustive]
pub enum AssetError { ExternalMissing { id: &'static str, path: String, hint: &'static str, analyzer: &'static str, }, Unknown(String), FetchNotPermitted { id: &'static str, files: usize, first: &'static str, analyzer: &'static str, }, Fetch { id: &'static str, url: &'static str, message: String, }, UnsafeInstallPath { id: &'static str, path: &'static str, }, UnsupportedPlatform { id: &'static str, os: &'static str, arch: &'static str, supported: String, }, ArchiveMissing { id: &'static str, target: &'static str, path: String, }, DigestMismatch { id: &'static str, url: String, expected: &'static str, expected_bytes: u64, actual: String, actual_bytes: u64, }, Io { path: String, source: Error, }, Record(Error), }
Expand description

Errors raised while provisioning.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ExternalMissing

An AssetSource::External asset is not present, and Roteiro will not fetch it. The message names the command that obtains it.

Fields

§id: &'static str

The asset id.

§path: String

Where it was expected.

§hint: &'static str

The command that obtains it.

§analyzer: &'static str

The analyzer that needs it.

§

Unknown(String)

This build has no such asset.

§

FetchNotPermitted

A downloadable asset was asked for without a fetcher, which is what every path except roteiro security prefetch does.

This is the offline contract stated as an error rather than as a comment: a run that finds a cold cache is told what to run, and is never quietly given a network connection instead.

Fields

§id: &'static str

The asset id.

§files: usize

How many files it is made of.

§first: &'static str

The first URL, so the message names something concrete.

§analyzer: &'static str

The analyzer that needs it.

§

Fetch

A download failed. The message is the fetcher’s, because it knows what went wrong and this module deliberately knows no transport.

Fields

§id: &'static str

The asset id.

§url: &'static str

The URL that failed.

§message: String

What the fetcher reported.

§

UnsafeInstallPath

A DownloadFile::path is not a plain relative path.

Checked rather than trusted: these paths are compiled in today, but they name where bytes from the network are written, and a .. in one would write outside the asset cache.

Fields

§id: &'static str

The asset id.

§path: &'static str

The offending path.

§

UnsupportedPlatform

No sandbox runtime is pinned for this host platform.

Refused by name rather than left to fail as a link error later: a platform Roteiro has not pinned is a platform whose runtime bytes nobody has verified, and building against unverified bytes is the thing this whole path exists to prevent.

Fields

§id: &'static str

The asset id.

§os: &'static str

std::env::consts::OS for the host.

§arch: &'static str

std::env::consts::ARCH for the host.

§supported: String

The platforms that do have a pin, comma-separated.

§

ArchiveMissing

A pinned archive is not provisioned, and this code path does not download.

Fields

§id: &'static str

The asset id.

§target: &'static str

The host platform it would be fetched for.

§path: String

Where it was expected.

§

DigestMismatch

A pinned archive’s bytes are not the bytes that were pinned.

This is the check that makes the sandbox runtime reproducible, so it is a hard failure with no override: a mismatch is either a truncated download, a redirected URL, or a substituted artifact, and none of those is something to carry on from. The size is reported alongside because a short body is the common case and two unequal digests do not say so.

Fields

§id: &'static str

The asset id.

§url: String

Where the bytes came from.

§expected: &'static str

The digest that was pinned.

§expected_bytes: u64

The size that was pinned.

§actual: String

The digest of what arrived.

§actual_bytes: u64

The size of what arrived.

§

Io

Reading or writing the cache failed.

Fields

§path: String

What was being touched.

§source: Error

The underlying failure.

§

Record(Error)

The provisioning record could not be read or written.

Trait Implementations§

Source§

impl Debug for AssetError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AssetError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for AssetError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AssetError> for ExecError

Source§

fn from(source: AssetError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for AssetError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErrorExt for T
where T: Error + Send + Sync + 'static,

Source§

fn raise(self) -> Exn<Self>
where Self: Sized,

Raise this error as a new exception.
Source§

fn and_raise<T>(self, context: T) -> Exn<T>
where T: Error + Send + Sync + 'static, Self: Sized,

Raise this error as a child of a new exception with the given context error. Read more
Source§

fn raise_erased(self) -> Exn
where Self: Sized,

Raise this error as a new exception, with type erasure.
Source§

fn raise_all<T, I>(self, sources: I) -> Exn<Self>
where Self: Sized, T: Error + Send + Sync + 'static, I: IntoIterator, <I as IntoIterator>::Item: Into<Exn<T>>,

Raise this error as a new exception, with sources as causes.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.