RragError

Enum RragError 

Source
pub enum RragError {
Show 14 variants DocumentProcessing { message: String, source: Option<Box<dyn Error + Send + Sync>>, }, Embedding { content_type: String, message: String, source: Option<Box<dyn Error + Send + Sync>>, }, Storage { operation: String, source: Box<dyn Error + Send + Sync>, }, RsllmClient { operation: String, source: Box<dyn Error + Send + Sync>, }, Retrieval { query: String, source: Option<Box<dyn Error + Send + Sync>>, }, ToolExecution { tool: String, message: String, source: Option<Box<dyn Error + Send + Sync>>, }, Configuration { field: String, expected: String, actual: String, }, Network { operation: String, source: Box<dyn Error + Send + Sync>, }, Serialization { data_type: String, source: Error, }, Timeout { operation: String, duration_ms: u64, }, Memory { operation: String, message: String, }, Stream { context: String, message: String, }, Agent { agent_id: String, message: String, source: Option<Box<dyn Error + Send + Sync>>, }, Validation { field: String, constraint: String, value: String, },
}
Expand description

Main error type for RRAG operations

Designed with Rust’s error handling best practices:

  • Uses thiserror for automatic trait implementations
  • Provides structured error data for programmatic handling
  • Includes source chain for debugging
  • Categorizes errors for metrics and logging

Variants§

§

DocumentProcessing

Document processing errors

Fields

§message: String

Error message describing what went wrong

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

Optional source error that caused this failure

§

Embedding

Embedding generation errors

Fields

§content_type: String

Type of content that failed to embed (text, image, etc.)

§message: String

Error message describing the failure

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

Optional source error that caused this failure

§

Storage

Vector storage errors

Fields

§operation: String

Storage operation that failed (insert, query, delete, etc.)

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

Source error from the storage backend

§

RsllmClient

rsllm client errors

Fields

§operation: String

Client operation that failed (request, auth, etc.)

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

Source error from the rsllm client

§

Retrieval

Retrieval/search errors

Fields

§query: String

Query that failed to execute

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

Optional source error that caused this failure

§

ToolExecution

Tool execution errors

Fields

§tool: String

Name of the tool that failed

§message: String

Error message from the tool execution

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

Optional source error that caused this failure

§

Configuration

Configuration errors

Fields

§field: String

Configuration field that has an invalid value

§expected: String

Expected value or format for the field

§actual: String

Actual value that was provided

§

Network

Network/IO errors

Fields

§operation: String

Network operation that failed (request, response, etc.)

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

Source error from the network operation

§

Serialization

Serialization/deserialization errors

Fields

§data_type: String

Type of data that failed to serialize/deserialize

§source: Error

Source error from the serialization library

§

Timeout

Timeout errors

Fields

§operation: String

Operation that timed out

§duration_ms: u64

Duration in milliseconds before timeout

§

Memory

Memory/conversation errors

Fields

§operation: String

Memory operation that failed

§message: String

Error message describing the failure

§

Stream

Streaming errors

Fields

§context: String

Context where the stream error occurred

§message: String

Error message describing the stream failure

§

Agent

Agent execution errors

Fields

§agent_id: String

ID of the agent that encountered the error

§message: String

Error message from the agent

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

Optional source error that caused this failure

§

Validation

Validation errors

Fields

§field: String

Field that failed validation

§constraint: String

Validation constraint that was violated

§value: String

Value that failed validation

Implementations§

Source§

impl RragError

Source

pub fn document_processing(message: impl Into<String>) -> Self

Create a document processing error

Source

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

Create a document processing error with source

Source

pub fn embedding( content_type: impl Into<String>, message: impl Into<String>, ) -> Self

Create an embedding error

Source

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

Create a storage error

Source

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

Create an rsllm client error

Source

pub fn retrieval(query: impl Into<String>) -> Self

Create a retrieval error

Source

pub fn evaluation(message: impl Into<String>) -> Self

Create an evaluation error

Source

pub fn tool_execution( tool: impl Into<String>, message: impl Into<String>, ) -> Self

Create a tool execution error

Source

pub fn config( field: impl Into<String>, expected: impl Into<String>, actual: impl Into<String>, ) -> Self

Create a configuration error

Source

pub fn timeout(operation: impl Into<String>, duration_ms: u64) -> Self

Create a timeout error

Source

pub fn memory(operation: impl Into<String>, message: impl Into<String>) -> Self

Create a memory error

Source

pub fn stream(context: impl Into<String>, message: impl Into<String>) -> Self

Create a stream error

Source

pub fn agent(agent_id: impl Into<String>, message: impl Into<String>) -> Self

Create an agent error

Source

pub fn validation( field: impl Into<String>, constraint: impl Into<String>, value: impl Into<String>, ) -> Self

Create a validation error

Source

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

Create a network error

Source

pub fn configuration(message: impl Into<String>) -> Self

Create a configuration error (shorthand for config method)

Source

pub fn serialization_with_message( data_type: impl Into<String>, message: impl Into<String>, ) -> Self

Create a serialization error with message

Source

pub fn io_error(message: impl Into<String>) -> Self

Create an I/O error

Source

pub fn is_retryable(&self) -> bool

Check if this error suggests a retry might succeed

Source

pub fn category(&self) -> &'static str

Get error category for metrics and logging

Source

pub fn severity(&self) -> ErrorSeverity

Get error severity level

Trait Implementations§

Source§

impl Debug for RragError

Source§

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

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

impl Display for RragError

Source§

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

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

impl Error for RragError

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<Elapsed> for RragError

Source§

fn from(_err: Elapsed) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RragError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RragError

Available on crate feature http only.
Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<GraphError> for RragError

Source§

fn from(err: GraphError) -> Self

Converts to this type from the input type.
Source§

impl From<RsllmError> for RragError

Available on crate feature rexis-llm-client only.
Source§

fn from(err: RsllmError) -> 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 = Infallible

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,