Skip to main content

MeshError

Enum MeshError 

Source
#[non_exhaustive]
pub enum MeshError { HistoricalRangeUnavailable { origin: u64, requested: Range<SeqNum>, available: Vec<Range<SeqNum>>, }, LineageMaxDepthExceeded { origin: u64, depth: u32, }, LineageCycleDetected { origin: u64, cycle: Vec<u64>, }, JoinMemoryExceeded { strategy: String, threshold_bytes: u64, }, QueryBudgetExceeded { metric: BudgetMetric, used: u64, limit: u64, }, PartialResult { rows: Vec<ResultRow>, continuation: Vec<u8>, reason: String, }, PlannerError { detail: String, }, ExecutorError { node: u64, detail: String, }, NoCapableHolder { origin: u64, requirement: String, }, AmbiguousDiscovery { matches: Vec<u64>, requirement: String, }, QueryCancelled, }
Expand description

Typed errors for MeshDB. Returned by both the planner (PlannerError, NoCapableHolder, LineageMaxDepthExceeded) and the executor (HistoricalRangeUnavailable, JoinMemoryExceeded, QueryBudgetExceeded, PartialResult, ExecutorError, QueryCancelled).

#[non_exhaustive] so phases B–F can add variants (StreamingTimeout, WatermarkExpired, etc.) without breaking source-side users.

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

HistoricalRangeUnavailable

No node holds the requested seq range. The available list carries the per-replica seq-range hints so callers can negotiate a different window.

Fields

§origin: u64

Chain whose range is missing (substrate u64 origin hash).

§requested: Range<SeqNum>

What the query asked for.

§available: Vec<Range<SeqNum>>

What the substrate can currently serve (per replica, post-compaction).

§

LineageMaxDepthExceeded

Lineage walk hit the depth bound before terminating. Carry the depth so callers can decide whether to retry with a wider bound.

Fields

§origin: u64

Chain at which the walk started.

§depth: u32

Bound that was hit.

§

LineageCycleDetected

Lineage walk observed a cycle in the fork-of: graph. In principle the graph is a DAG; cycles indicate broken upstream applications. The cycle path is included for debugging.

Fields

§origin: u64

Chain at which the walk started.

§cycle: Vec<u64>

The sequence of chain hashes that closed the cycle.

§

JoinMemoryExceeded

A join’s working-set memory exceeded the planner’s configured threshold. Carry the strategy + threshold so dashboards can disambiguate “broadcast was too big” from “hash-partition shuffle was too big”.

Fields

§strategy: String

Which join strategy ran out of room.

§threshold_bytes: u64

Configured memory bound, in bytes.

§

QueryBudgetExceeded

The query exceeded one of its per-channel budgets (query_max_rows, query_max_duration, query_max_bytes_scanned). Returns the metric + the observed-vs-limit pair.

Fields

§metric: BudgetMetric

Which budget hit the limit.

§used: u64

Observed value at the point of failure.

§limit: u64

Configured limit.

§

PartialResult

Query terminated early but produced usable rows. Carry the rows + a continuation token so the caller can resume. The reason field is a short human- readable diagnostic.

Fields

§rows: Vec<ResultRow>

Rows produced before termination.

§continuation: Vec<u8>

Opaque continuation token. The executor knows how to resume from this; opaque to callers.

§reason: String

Short human-readable diagnostic explaining why the result was partial (network blip, planner downgrade, replica failover, etc.).

§

PlannerError

Planner-side failure — unsupported operator, malformed AST, version mismatch. Distinct from ExecutorError so dashboards can split “couldn’t plan” from “ran but failed mid-execution”.

Fields

§detail: String

Diagnostic detail.

§

ExecutorError

Executor-side failure on a specific node. Carry the node_id so operators can route the report at the right peer.

Fields

§node: u64

node_id of the executor that failed.

§detail: String

Diagnostic detail.

§

NoCapableHolder

ChainRef::Discovered resolved to zero candidates. Carry the requirement (in human-readable form) so callers can adjust their predicate.

Fields

§origin: u64

Origin hash (zeroed if the failure is at discovery time before any concrete hash is known).

§requirement: String

Rendered predicate or requirement string for diagnostics.

§

AmbiguousDiscovery

ChainRef::Discovered matched more than one origin. Until Phase B’s fan-out lands, the planner refuses rather than silently truncating to the first match. Callers should tighten their predicate or, once Phase B ships, switch to a multi-origin union query.

Fields

§matches: Vec<u64>

The origin hashes that matched the predicate.

§requirement: String

Rendered predicate or requirement string for diagnostics.

§

QueryCancelled

Query cancelled via MeshQueryExecutor::cancel. Distinct from ExecutorError so callers can route cancellations differently (they’re not failures).

Implementations§

Source§

impl MeshError

Source

pub fn kind(&self) -> &'static str

Stable, short, snake_case string discriminator for the variant. Used by the FFI shims (Python / Node / Go) to expose a kind field on the host-language error so callers can branch on the error type without parsing the rendered message. Values are part of the public SDK contract — adding new variants is fine, renaming existing ones is a breaking change.

Trait Implementations§

Source§

impl Clone for MeshError

Source§

fn clone(&self) -> MeshError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MeshError

Source§

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

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

impl<'de> Deserialize<'de> for MeshError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for MeshError

Source§

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

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

impl Error for MeshError

1.30.0 · 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 PartialEq for MeshError

Source§

fn eq(&self, other: &MeshError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MeshError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MeshError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, 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