Skip to main content

GraphError

Enum GraphError 

Source
pub enum GraphError {
Show 23 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, }, NonPositiveDelay { id: String, found: u64, }, ApprovalSchemaNotObject { id: String, }, Cycle { path: String, }, EdgeTypeMismatch { from: String, to: String, }, InvalidBranchExpression { node: String, case: String, error: String, }, ModelDecisionWithoutAgent { node: String, case: String, }, BranchCaseWithoutEdge { node: String, case: String, }, BranchEdgeWithoutCase { node: String, label: String, }, BranchEdgeWithoutLabel { node: String, to: String, }, InvalidFoldStopExpression { node: String, error: String, }, InvalidFoldJoinReference { node: String, reference: String, error: String, }, FoldStopPathNotInBodySchema { node: String, path: String, body: String, }, FoldJoinReferenceNotInBodySchema { node: String, reference: String, body: 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.

§

NonPositiveDelay

A delay node’s wait is zero.

Refused rather than accepted as a no-op, on the same reasoning GraphError::NonPositiveMaxIterations rests on: the whole meaning of the node is the wait, so a wait of nothing is an authoring mistake and not an intent. A zero delay would still park nothing, record a clock reading, a SleepStarted, and a SleepCompleted in every log forever, and mean exactly what deleting the node means. Saying so at submit is cheaper than leaving it to be noticed in a run log.

Fields

§id: String

The delay node’s id.

§found: u64

The declared wait.

§

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.

§

BranchCaseWithoutEdge

A branch node case names no outbound edge from that node: no edge’s label matches the case name. Caught at submit, because otherwise the engine fires the case at run time, finds no live edge, skips every node downstream of it, and the run completes as if that were the intended path. See [check_branch_case_edges].

Fields

§node: String

The branch node’s id.

§case: String

The name of the case with no matching edge.

§

BranchEdgeWithoutCase

An outbound edge from a branch node carries a label that matches no case the branch declares. Caught at submit for the same reason as GraphError::BranchCaseWithoutEdge, from the other side: the engine only ever takes a branch’s edge by matching the fired case’s name against the label, so a label naming nothing can never fire and the edge just sits there, dead. See [check_branch_edge_labels].

Fields

§node: String

The branch node’s id.

§label: String

The edge label that matches no declared case.

§

BranchEdgeWithoutLabel

An outbound edge from a branch node carries no label at all. Caught at submit for the same engine reason as GraphError::BranchEdgeWithoutCase: salvor_engine::is_live_inbound only ever takes a branch’s edge by matching the fired case’s name against the edge’s label, and a fired case’s name is always Some, so an edge whose label is None can never match it either. Such an edge can never fire, exactly like one whose label matches no case, so it gets the same treatment: a submit-time, node- and target-precise error instead of a route that silently never gets taken. See [check_branch_edge_labels].

Fields

§node: String

The branch node’s id.

§to: String

The edge’s destination.

§

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.

§

FoldStopPathNotInBodySchema

A fold node’s stop_when predicate reads a path the body node’s declared output_schema does not describe. See [check_fold_reference_shapes] for when this fires and, more importantly, when it stays quiet.

Fields

§node: String

The fold node’s id.

§path: String

The path the predicate reads, as the expression names it.

§body: String

The id of the body node whose schema does not describe it.

§

FoldJoinReferenceNotInBodySchema

A fold node’s best_by join reference names a path the body node’s declared output_schema does not describe. The join half of GraphError::FoldStopPathNotInBodySchema, reported separately because the two are fixed in different places.

Fields

§node: String

The fold node’s id.

§reference: String

The join reference, as the document writes it.

§body: String

The id of the body node whose schema does not describe it.

§

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 = !

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.