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
DuplicateNodeId
Two nodes share an id. Node ids must be unique within a document.
DanglingEdge
An edge names a node id that does not exist.
Fields
DanglingMapBody
A map node’s node body references a node id that does not exist.
Fields
DanglingFoldBody
A fold node’s node body references a node id that does not exist.
Fields
MalformedAgentHash
An agent node’s hash is not a well-formed sha256:<64 lowercase hex>
string.
NonPositiveConcurrency
A map node’s concurrency cap is not positive.
NonPositiveMaxIterations
A fold node’s iteration bound is not positive.
ApprovalSchemaNotObject
A gate node’s approval schema is not a JSON object.
Cycle
The edge list contains a cycle. path renders it as a -> b -> ... -> a.
EdgeTypeMismatch
An edge connects two nodes whose declared schemas do not match. See
[check_edge_type_compat] for the deliberately conservative rule.
Fields
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
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
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.
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
NodeNameTooLong
A node’s optional name is over MAX_NODE_NAME_LEN characters.
Fields
max: usizeMAX_NODE_NAME_LEN, repeated here so the error is self-contained.
BlankNodeName
A node’s optional name is set but empty or all whitespace.
Trait Implementations§
Source§impl Clone for GraphError
impl Clone for GraphError
Source§fn clone(&self) -> GraphError
fn clone(&self) -> GraphError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphError
impl Debug for GraphError
Source§impl Display for GraphError
impl Display for GraphError
impl Eq for GraphError
Source§impl Error for GraphError
impl Error for GraphError
1.30.0 · 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()