pub enum RegulaError {
Show 42 variants
DuplicateNode(String),
NodeNotFound(String),
InvalidEdgeSource(String),
InvalidEdgeTarget(String),
NoEntryPoint,
InvalidCycle(String),
UnreachableNode(String),
AmbiguousRouting(String),
NoConditionalTargets(String),
NodeExecution {
node: String,
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
InvalidRouteTarget(String, String),
MaxIterationsExceeded(usize),
Interrupted(String),
Cancelled,
AlreadyCompleted,
NoPendingTasks,
EmptyChannel(String),
ChannelTypeMismatch {
channel: String,
expected: String,
actual: String,
},
ReducerFailed {
channel: String,
message: String,
},
StateSerialization(Error),
MissingStateField(String),
UnknownStateField(String),
CheckpointNotFound(String),
CheckpointStorage(String),
CheckpointDeserialization(String),
CheckpointVersionMismatch {
expected: String,
actual: String,
},
NoCheckpointer,
LlmRequest(String),
LlmApiError {
status: u16,
message: String,
},
LlmResponseParse(String),
LlmRateLimited {
retry_after: Option<Duration>,
},
LlmStreaming(String),
LlmApiKeyMissing,
LlmTimeout(Duration),
InvalidConfig(String),
MissingConfig(String),
ConfigKeyNotFound(String),
ConfigTypeMismatch {
key: String,
expected: String,
},
Internal(String),
LockError(String),
Io(Error),
Other(Error),
}Expand description
The main error type for REGULA operations.
This enum covers all possible error conditions that can occur during graph construction, compilation, and execution.
Variants§
DuplicateNode(String)
A node with this name already exists in the graph.
NodeNotFound(String)
The specified node was not found in the graph.
InvalidEdgeSource(String)
An edge references a non-existent source node.
InvalidEdgeTarget(String)
An edge references a non-existent target node.
NoEntryPoint
The graph has no entry point (no edge from START).
InvalidCycle(String)
The graph contains a cycle without a valid exit condition.
UnreachableNode(String)
A node has no incoming edges and is unreachable.
AmbiguousRouting(String)
Multiple edges from the same source without conditional routing.
NoConditionalTargets(String)
A conditional edge has no valid targets defined.
NodeExecution
A node’s execution failed.
Fields
InvalidRouteTarget(String, String)
A router returned an invalid or unknown target node.
MaxIterationsExceeded(usize)
The graph exceeded the maximum number of iterations.
Interrupted(String)
Graph execution was interrupted by a breakpoint or interrupt() call.
Cancelled
Graph execution was cancelled.
AlreadyCompleted
The graph has already completed and cannot continue.
NoPendingTasks
No pending tasks to execute.
EmptyChannel(String)
Attempted to read from a channel that has no value.
ChannelTypeMismatch
Type mismatch when reading or writing a channel.
Fields
ReducerFailed
A reducer function failed to combine values.
StateSerialization(Error)
State serialization or deserialization failed.
MissingStateField(String)
A required state field is missing.
UnknownStateField(String)
State update contained an unknown field.
CheckpointNotFound(String)
No checkpoint found for the given thread ID.
CheckpointStorage(String)
Checkpoint storage operation failed.
CheckpointDeserialization(String)
Failed to deserialize a checkpoint.
CheckpointVersionMismatch
Checkpoint version mismatch.
NoCheckpointer
No checkpointer configured but checkpoint operation requested.
LlmRequest(String)
HTTP request to LLM API failed.
LlmApiError
LLM API returned an error response.
LlmResponseParse(String)
Failed to parse LLM response.
LlmRateLimited
LLM API rate limit exceeded.
LlmStreaming(String)
Error during LLM streaming.
LlmApiKeyMissing
LLM API key is missing or invalid.
LlmTimeout(Duration)
LLM request timed out.
InvalidConfig(String)
Invalid configuration value.
MissingConfig(String)
Required configuration is missing.
ConfigKeyNotFound(String)
Configuration key not found in context.
ConfigTypeMismatch
Configuration value type mismatch.
Internal(String)
Internal framework error.
LockError(String)
Lock acquisition failed (concurrency error).
Io(Error)
Generic I/O error.
Other(Error)
Wrapper for other error types.
Implementations§
Source§impl RegulaError
impl RegulaError
Sourcepub fn node_execution(
node: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn node_execution( node: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
Create a node execution error with a source error.
Sourcepub fn node_execution_msg(
node: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn node_execution_msg( node: impl Into<String>, message: impl Into<String>, ) -> Self
Create a node execution error with just a message.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if this error is a cancellation.
Trait Implementations§
Source§impl Debug for RegulaError
impl Debug for RegulaError
Source§impl Display for RegulaError
impl Display for RegulaError
Source§impl Error for RegulaError
impl Error for RegulaError
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()