Skip to content

Exceptions

Defines the typed exceptions raised by gllm-rag.

Every concrete exception also inherits from the built-in exception it replaces, so existing except ValueError, except TypeError, except RuntimeError and except NotImplementedError handlers keep working.

BaseRAGError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: BaseError

Base class for all gllm-rag errors. Never raised directly.

Attributes:

Name Type Description
code str | None

Stable error code. Defined by each concrete subclass.

default_message str | None

Message used when no message is given. Defined by each concrete subclass.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.

RAGNotImplementedError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: BaseRAGError, NotImplementedError

Raised when a RAG operation is not supported by the selected strategy.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RAG-NOT-IMPLEMENTED.

default_message str

Message used when no message is given.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.

RAGRuntimeError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: BaseRAGError, RuntimeError

Raised when the RAG pipeline fails to run.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RAG-RUNTIME.

default_message str

Message used when no message is given.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.

RAGTypeError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: BaseRAGError, TypeError

Raised when a RAG component receives a value of the wrong type.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RAG-TYPE.

default_message str

Message used when no message is given.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.

RAGValueError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: BaseRAGError, ValueError

Raised when a RAG request or configuration is invalid.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RAG-VALIDATION.

default_message str

Message used when no message is given.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.

SyncCallInEventLoopError(message=None, *, debug_info=None, recovery=None, original_error=None)

Bases: RAGRuntimeError

Raised when a synchronous entry point is called inside a running event loop.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RAG-SYNC-IN-LOOP.

default_message str

Message used when no message is given.

message str

The message of this error.

debug_info DebugInfo

Structured internal detail about this error.