Skip to main content

AppDataError

Enum AppDataError 

Source
#[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
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.
§

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

§category: &'static str

serde failure category: "syntax", "data", "eof", or "io".

§line: usize

1-based line where decoding failed, or 0 when the position is unknown.

§column: usize

1-based column where decoding failed, or 0 when the position is unknown.

§

InvalidAppDataProvided

The supplied app-data document failed semantic validation.

Fields

§field: &'static str

Public field name that failed validation.

§reason: ValidationReason

Canonical validation-failure mode.

§

InvalidPartnerFee

A partner-fee policy failed semantic validation against the documented basis-point bounds or recipient preconditions.

Fields

§field: &'static str

Public field name that failed validation.

§reason: ValidationReason

Canonical 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 str

Public field name that failed validation, spelled as the camelCase wire key for stable error observability.

§reason: ValidationReason

Canonical 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: TransportErrorClass

Classification of the underlying REST-transport failure.

§detail: Redacted<String>

Redacted detail message sourced from the transport layer.

§

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.

Fields

§actual_bytes: usize

Size of the stringified document in bytes.

§max_bytes: usize

Configured size ceiling in bytes.

Implementations§

Source§

impl AppDataError

Source

pub const fn class(&self) -> ErrorClass

Returns the coarse-grained ErrorClass for this error.

Trait Implementations§

Source§

impl Debug for AppDataError

Source§

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

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

impl Display for AppDataError

Source§

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

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

impl Error for AppDataError

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<Cancelled> for AppDataError

Source§

fn from(_: Cancelled) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for AppDataError

Source§

fn from(error: Error) -> Self

Captures only the serde failure category and structural position.

The raw serde_json::Error rendering can echo bytes from a decoded document or response body, so it is intentionally dropped here (ADR 0025); only the category/line/column triple is retained.

Source§

impl Serialize for AppDataError

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more