Skip to main content

compmd_host/
manifest_error.rs

1//! Why a bundle's manifest can't be used.
2
3/// What is wrong with a `manifest.json`.
4#[derive(Debug, thiserror::Error, PartialEq, Eq)]
5pub enum ManifestError {
6    /// It isn't the manifest's JSON, or a name, path or integrity in it isn't one.
7    #[error("the bundle's manifest can't be read: {0}")]
8    Json(String),
9    /// It was written by a version of `@compmd/vite` this crate doesn't know.
10    #[error(
11        "the bundle's manifest is format {found}, and this compmd-host reads format {known}: upgrade compmd-host to the version of the @compmd packages that built the bundle"
12    )]
13    UnknownFormat {
14        /// The format it names.
15        found: u32,
16        /// The format this crate reads.
17        known: u32,
18    },
19    /// The frames' hash isn't 16 lowercase hex digits, so it could name another folder.
20    #[error("the frames' hash `{0}` isn't 16 lowercase hex digits")]
21    Hash(String),
22    /// Its `policy` isn't the processor's policy.
23    #[error("the bundle's manifest has a policy the processor can't read: {0}")]
24    Policy(String),
25}