Skip to content

Exceptions

Defines the exceptions raised by gllm-retrieval.

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

Bases: BaseError

Base class for all errors raised by gllm-retrieval.

This class is abstract and is never raised directly. Every concrete subclass must define code using the format GLLM-RTVL-<NAME> and default_message.

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.

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

Bases: BaseRetrievalError, NotImplementedError

Raised when a retrieval component does not support the requested operation.

Also a NotImplementedError, so existing except NotImplementedError handlers keep working.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RTVL-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.

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

Bases: BaseRetrievalError, RuntimeError

Raised when a retrieval component fails while running.

Also a RuntimeError, so existing except RuntimeError handlers keep working.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RTVL-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.

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

Bases: BaseRetrievalError, TypeError

Raised when a value passed to a retrieval component has an unexpected type.

Also a TypeError, so existing except TypeError handlers keep working.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RTVL-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.

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

Bases: BaseRetrievalError, ValueError

Raised when an input or configuration value of a retrieval component is invalid.

Also a ValueError, so existing except ValueError handlers keep working.

Attributes:

Name Type Description
code str

Stable error code, GLLM-RTVL-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.