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
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.
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.
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
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].
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
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].
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
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
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
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()