#[non_exhaustive]pub enum AppDataError {
InvalidAppDataHex,
InvalidCid,
InvalidSchemaVersion(Redacted<String>),
MissingSchemaVersion,
Serialization {
category: &'static str,
line: usize,
column: usize,
},
InvalidAppDataProvided {
field: &'static str,
reason: ValidationReason,
},
InvalidPartnerFee {
field: &'static str,
reason: ValidationReason,
},
InvalidFlashloanHints {
field: &'static str,
reason: ValidationReason,
},
Calculation {
source: Box<dyn Error + Send + Sync + 'static>,
},
Transport {
class: TransportErrorClass,
detail: Redacted<String>,
},
Cancelled,
TooLarge {
actual_bytes: usize,
max_bytes: usize,
},
}Expand description
Errors returned by app-data generation, validation, transport, and CID helpers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidAppDataHex
The supplied app-data hash was not valid 0x-prefixed 32-byte hex.
InvalidCid
The supplied CID was malformed or unsupported.
InvalidSchemaVersion(Redacted<String>)
The supplied schema version did not match the expected major.minor.patch format.
MissingSchemaVersion
The app-data document did not contain a string version field.
Serialization
JSON serialization or decoding failed.
Only the serde failure category and the structural position are
surfaced. The raw serde_json::Error rendering can echo bytes from a
decoded document or response body, so the conversion drops it
(ADR 0025); the category/line/column triple is the safe structural
diagnostic, mirroring cow_sdk_orderbook::OrderbookError::Serialization.
Fields
InvalidAppDataProvided
The supplied app-data document failed semantic validation.
Fields
reason: ValidationReasonCanonical validation-failure mode.
InvalidPartnerFee
A partner-fee policy failed semantic validation against the documented basis-point bounds or recipient preconditions.
Fields
reason: ValidationReasonCanonical validation-failure mode.
InvalidFlashloanHints
A flash-loan hint failed semantic validation against the documented
bounds for amount or the non-zero-address preconditions on
liquidityProvider, protocolAdapter, receiver, and token.
Fields
field: &'static strPublic field name that failed validation, spelled as the camelCase wire key for stable error observability.
reason: ValidationReasonCanonical validation-failure mode.
Calculation
CID or digest calculation failed with a typed underlying error preserved through the error-source chain.
The boxed source is intentionally not rendered into Display or
Serialize: a future hashing or CID backend could embed
caller-derived bytes in its message, so only the stable operation
label is surfaced (ADR 0025). Callers that need the precise failure
walk std::error::Error::source.
Fields
source: Box<dyn Error + Send + Sync + 'static>Typed source error returned by the underlying hashing or CID
crate. Boxed as a trait object so the variant can carry either
a cid-crate or a multihash-crate failure without
widening the enum surface. Reachable through
std::error::Error::source for callers that deliberately cross
the redaction boundary.
Transport
Fetch-transport configuration or execution failed.
Fields
class: TransportErrorClassClassification of the underlying REST-transport failure.
Cancelled
A long-running app-data operation was cancelled through a cooperative cancellation token.
TooLarge
The stringified app-data document exceeded the configured size ceiling.
Implementations§
Source§impl AppDataError
impl AppDataError
Sourcepub const fn class(&self) -> ErrorClass
pub const fn class(&self) -> ErrorClass
Returns the coarse-grained ErrorClass for this error.
Trait Implementations§
Source§impl Debug for AppDataError
impl Debug for AppDataError
Source§impl Display for AppDataError
impl Display for AppDataError
Source§impl Error for AppDataError
impl Error for AppDataError
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<Cancelled> for AppDataError
impl From<Cancelled> for AppDataError
Source§impl From<Error> for AppDataError
impl From<Error> for AppDataError
Auto Trait Implementations§
impl !RefUnwindSafe for AppDataError
impl !UnwindSafe for AppDataError
impl Freeze for AppDataError
impl Send for AppDataError
impl Sync for AppDataError
impl Unpin for AppDataError
impl UnsafeUnpin for AppDataError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.