Skip to main content

GraphError

Enum GraphError 

Source
pub enum GraphError {
Show 17 variants UnsupportedSchemaVersion { found: u32, supported: u32, }, DuplicateNodeId { id: String, }, DanglingEdge { from: String, to: String, missing: String, suggestion: Option<String>, }, DanglingMapBody { id: String, missing: String, suggestion: Option<String>, }, DanglingFoldBody { id: String, missing: String, suggestion: Option<String>, }, MalformedAgentHash { id: String, hash: String, }, NonPositiveConcurrency { id: String, found: u32, }, NonPositiveMaxIterations { id: String, found: u32, }, ApprovalSchemaNotObject { id: String, }, Cycle { path: String, }, EdgeTypeMismatch { from: String, to: String, }, InvalidBranchExpression { node: String, case: String, error: String, }, ModelDecisionWithoutAgent { node: String, case: String, }, InvalidFoldStopExpression { node: String, error: String, }, InvalidFoldJoinReference { node: String, reference: String, error: String, }, NodeNameTooLong { id: String, len: usize, max: usize, }, BlankNodeName { id: String, },
}
Expand description

A single validation failure, naming the node or edge at fault.

PartialEq is derived so tests can assert on the exact error value. Each variant’s Display (via thiserror) is the human message the CLI prints.

Variants§

§

UnsupportedSchemaVersion

The document declares a schema_version this build cannot understand (greater than SCHEMA_VERSION, or zero).

Fields

§found: u32

The version the document declared.

§supported: u32

The newest version this build understands.

§

DuplicateNodeId

Two nodes share an id. Node ids must be unique within a document.

Fields

§id: String

The repeated id.

§

DanglingEdge

An edge names a node id that does not exist.

Fields

§from: String

The edge’s declared source.

§to: String

The edge’s declared destination.

§missing: String

The endpoint id that does not exist (either from or to).

§suggestion: Option<String>

The nearest existing id, when one is close enough to suggest.

§

DanglingMapBody

A map node’s node body references a node id that does not exist.

Fields

§id: String

The map node’s id.

§missing: String

The referenced id that does not exist.

§suggestion: Option<String>

The nearest existing id, when one is close enough to suggest.

§

DanglingFoldBody

A fold node’s node body references a node id that does not exist.

Fields

§id: String

The fold node’s id.

§missing: String

The referenced id that does not exist.

§suggestion: Option<String>

The nearest existing id, when one is close enough to suggest.

§

MalformedAgentHash

An agent node’s hash is not a well-formed sha256:<64 lowercase hex> string.

Fields

§id: String

The agent node’s id.

§hash: String

The malformed hash string.

§

NonPositiveConcurrency

A map node’s concurrency cap is not positive.

Fields

§id: String

The map node’s id.

§found: u32

The declared cap.

§

NonPositiveMaxIterations

A fold node’s iteration bound is not positive.

Fields

§id: String

The fold node’s id.

§found: u32

The declared bound.

§

ApprovalSchemaNotObject

A gate node’s approval schema is not a JSON object.

Fields

§id: String

The gate node’s id.

§

Cycle

The edge list contains a cycle. path renders it as a -> b -> ... -> a.

Fields

§path: String

The cycle rendered as a node-id path, closing back on its start.

§

EdgeTypeMismatch

An edge connects two nodes whose declared schemas do not match. See [check_edge_type_compat] for the deliberately conservative rule.

Fields

§from: String

The source node id (its output schema).

§to: String

The destination node id (its input schema).

§

InvalidBranchExpression

A branch node case carries an expression condition that does not parse in the crate::expr condition language. Caught at submit so a bad expression is never a run-time failure.

Fields

§node: String

The branch node’s id.

§case: String

The name of the offending case.

§error: String

The parse error’s message.

§

ModelDecisionWithoutAgent

A branch node carries a model_decision case but declares no agent_hash, so the engine would have no agent to make the decision. Caught at submit, node- and case-precise.

Fields

§node: String

The branch node’s id.

§case: String

The name of the model-decision case with no agent.

§

InvalidFoldStopExpression

A fold node’s stop_when predicate does not parse in the crate::expr condition language. Caught at submit so a bad predicate is never a run-time failure, exactly like a branch case’s expression.

Fields

§node: String

The fold node’s id.

§error: String

The parse error’s message.

§

InvalidFoldJoinReference

A fold node’s best_by join reference is not a well-formed path in the crate::expr language (a bare literal, or a malformed path). Caught at submit, node-precise.

Fields

§node: String

The fold node’s id.

§reference: String

The malformed reference.

§error: String

The parse error’s message.

§

NodeNameTooLong

A node’s optional name is over MAX_NODE_NAME_LEN characters.

Fields

§id: String

The node’s id.

§len: usize

The name’s length, in characters (chars().count(), not bytes).

§max: usize

MAX_NODE_NAME_LEN, repeated here so the error is self-contained.

§

BlankNodeName

A node’s optional name is set but empty or all whitespace.

Fields

§id: String

The node’s id.

Trait Implementations§

Source§

impl Clone for GraphError

Source§

fn clone(&self) -> GraphError

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 GraphError

Source§

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

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

impl Display for GraphError

Source§

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

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

impl Eq for GraphError

Source§

impl Error for GraphError

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 GraphError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GraphError

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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