Skip to main content

RegulaError

Enum RegulaError 

Source
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

§node: String

The name of the node that failed.

§message: String

The error message.

§source: Option<Box<dyn Error + Send + Sync>>

The underlying error, if any.

§

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

§channel: String

The channel name.

§expected: String

The expected type.

§actual: String

The actual type encountered.

§

ReducerFailed

A reducer function failed to combine values.

Fields

§channel: String

The channel name.

§message: String

The error message.

§

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.

Fields

§expected: String

The expected version.

§actual: String

The actual version.

§

NoCheckpointer

No checkpointer configured but checkpoint operation requested.

§

LlmRequest(String)

HTTP request to LLM API failed.

§

LlmApiError

LLM API returned an error response.

Fields

§status: u16

HTTP status code.

§message: String

Error message from the API.

§

LlmResponseParse(String)

Failed to parse LLM response.

§

LlmRateLimited

LLM API rate limit exceeded.

Fields

§retry_after: Option<Duration>

Suggested retry delay, if provided.

§

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.

Fields

§key: String

The configuration key.

§expected: String

The expected type.

§

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

Source

pub fn node_execution( node: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self

Create a node execution error with a source error.

Source

pub fn node_execution_msg( node: impl Into<String>, message: impl Into<String>, ) -> Self

Create a node execution error with just a message.

Source

pub fn is_retryable(&self) -> bool

Check if this error is retryable.

Source

pub fn is_cancelled(&self) -> bool

Check if this error is a cancellation.

Trait Implementations§

Source§

impl Debug for RegulaError

Source§

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

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

impl Display for RegulaError

Source§

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

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

impl Error for RegulaError

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 From<Error> for RegulaError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RegulaError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RegulaError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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, !>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more