#[non_exhaustive]pub enum BlobError {
HashMismatch {
expected: [u8; 32],
actual: [u8; 32],
},
UnsupportedScheme(String),
NotFound(String),
Backend(String),
Cancelled,
UnsupportedVersion(u8),
Decode(String),
AdapterNotConfigured,
AdapterNotRegistered(String),
Unauthorized(String),
ShortChunk {
hash: [u8; 32],
requested_start: u64,
requested_end: u64,
actual_len: u64,
},
}Expand description
Errors surfaced by super::BlobAdapter implementations and the
substrate’s blob-fetch path. Variants stay byte-stable across
bindings because they appear in error-routing logic on the
JS / Python / Go sides.
#[non_exhaustive] so binding-side FFI sites that match
exhaustively get a compile-time nudge when new variants land,
rather than silently routing unknown errors to a default arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HashMismatch
Adapter returned bytes whose BLAKE3 hash did not match the
expected hash carried in the super::BlobRef. The
substrate enforces verification so an adversarial adapter
cannot fake-verify. expected / actual are 32-byte
BLAKE3 outputs.
Fields
UnsupportedScheme(String)
BlobRef::uri carries a scheme this adapter does not
recognise (s3://, ipfs://, file://, etc.). The
substrate routes per scheme; surface from the routing layer
when no registered adapter claims the scheme.
NotFound(String)
Object did not exist at the adapter’s backend.
Backend(String)
Adapter-side I/O / network / auth failure. The string is the
adapter’s best-effort message; downstream telemetry consumes
the whole BlobError Display.
Cancelled
Caller cancelled the fetch (e.g. context dropped, future aborted).
UnsupportedVersion(u8)
BlobRef encoded with a version byte this build does not
understand. Reserved for migration headroom; current encoder
only emits super::blob_ref::BLOB_REF_VERSION_V1.
Decode(String)
BlobRef encoded form failed to decode (truncated /
corrupted bytes, bad postcard frame, etc.).
AdapterNotConfigured
Channel’s RedexFileConfig did not specify a
blob_adapter_id — substrate can’t route the BlobRef
resolve. Operator misconfiguration (vs AdapterNotRegistered
which is a deploy-ordering issue).
AdapterNotRegistered(String)
Channel’s configured blob_adapter_id is not present in
the registry — either an adapter that hasn’t been
registered yet (deploy-ordering race) or one that was
unregistered. Distinct from AdapterNotConfigured so
operators can tell apart “you forgot to set it” from
“you didn’t register the named adapter yet.”
Caller failed an authorization check on the blob op:
AuthGuard rejected the (origin_hash, ChannelName) ACL
lookup, or no guard was configured for an op that
requires one. Distinct from Backend so callers (and
metrics) can tell apart a 401-style security boundary hit
from a 500-style adapter failure. The string is the
authorization-side context; do not leak channel names or
principal identifiers if they’re sensitive.
ShortChunk
Backend returned a chunk whose length is shorter than the
manifest’s recorded chunk size — distinct from
Self::HashMismatch so retry logic can tell a
truncated tail (where the content may still hash
correctly over its visible prefix) from a fundamental
content disagreement. Pre-fix, an over-short chunk
surfaced as HashMismatch { expected, actual: blake3(short_bytes) },
where actual could even equal expected for a
truncated tail aligned to a block boundary, confusing
retry / divergence-detection callers.
Fields
Trait Implementations§
Source§impl Error for BlobError
impl Error for BlobError
1.30.0 · 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()
impl Eq for BlobError
impl StructuralPartialEq for BlobError
Auto Trait Implementations§
impl Freeze for BlobError
impl RefUnwindSafe for BlobError
impl Send for BlobError
impl Sync for BlobError
impl Unpin for BlobError
impl UnsafeUnpin for BlobError
impl UnwindSafe for BlobError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.