pub enum CatalogError {
AlreadyExists {
name_version: String,
},
InvalidNameVersion {
name_version: String,
reason: String,
},
RetiredWithDifferentContent {
name_version: String,
previous_hash: String,
new_hash: String,
},
NotFound {
name_version: String,
did_you_mean: Vec<String>,
},
UnqualifiedName {
name: String,
},
CorruptIndex {
path: PathBuf,
reason: String,
},
UnrecognizedArtifact {
path: PathBuf,
header: Vec<u8>,
},
UninspectableArtifact {
path: PathBuf,
reason: String,
},
MalformedHash {
hash: String,
},
Io(Error),
}Expand description
Something went wrong reading, writing, or resolving through the catalog.
Variants§
AlreadyExists
name@version was already catalogued; versions are immutable once published.
InvalidNameVersion
The identifier handed to add is not a well-formed name@version.
Fields
RetiredWithDifferentContent
name@version was published, then removed, and is now being re-added
with different content. Removing an entry drops it from the index but
does not un-publish the identity, so this is still the immutability
violation AlreadyExists guards against — just spread over two steps.
Fields
NotFound
No entry matches the requested name@version.
Fields
UnqualifiedName
An unqualified name was used somewhere that requires an exact version
(resolving a node reference already recorded inside a bundle’s
manifest — see ResolutionContext::Durable).
CorruptIndex
The catalog’s own index.json failed to parse.
UnrecognizedArtifact
The artifact’s magic bytes match neither a wasm module nor a bundle.
UninspectableArtifact
The artifact’s magic bytes were recognised, but its contents could not
be read: a wasm-magic file whose module body is truncated or
otherwise invalid, or a bundle-magic file whose manifest JSON fails to
parse. Distinct from CorruptIndex (that’s the catalog’s own
bookkeeping file, not an input artifact) and from
UnrecognizedArtifact (that’s the magic byte itself not matching
anything).
Fields
path: PathBufThe path that was handed to add, or a synthetic label standing
in for one — read_bundle_signature takes a label: &str that
need not be a real filesystem path. add always passes a real
on-disk path, but pipeline::check calls it with a stage’s
display name, which for a Cataloged stage (built by
pipeline::resolve_and_load from a bare catalog name, not a
filesystem path) is just that bare name.
MalformedHash
An entry’s hash came back from index.json in a shape that isn’t a
well-formed sha256 digest (64 lowercase hex digits, optionally
prefixed with sha256:) — the exact shape write_blob always
produces. index.json is never format-validated on read, so a
hand-edited or maliciously crafted index could otherwise smuggle
../ traversal or an absolute path into a filesystem join; this is
the guard that rejects it before that ever happens. Distinct from
CorruptIndex (that’s index.json failing to parse as JSON at
all; this is JSON that parses fine but whose hash field is
nonsense).
Io(Error)
Underlying I/O failure — a plain failure to open/read/write a path, before any catalog-specific logic ever inspects the bytes.
Trait Implementations§
Source§impl Debug for CatalogError
impl Debug for CatalogError
Source§impl Display for CatalogError
impl Display for CatalogError
Source§impl Error for CatalogError
impl Error for CatalogError
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()
Source§impl From<CatalogError> for PipelineError
impl From<CatalogError> for PipelineError
Source§fn from(source: CatalogError) -> Self
fn from(source: CatalogError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CatalogError
impl !UnwindSafe for CatalogError
impl Freeze for CatalogError
impl Send for CatalogError
impl Sync for CatalogError
impl Unpin for CatalogError
impl UnsafeUnpin for CatalogError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more