krrood.ormatic.exceptions#

Exceptions#

NoGenericError

Exception raised when the original class for a DataAccessObject subclass cannot be

NoDAOFoundError

Represents an error raised when no DAO (Data Access Object) class is found for a

NoDAOFoundForTypeError

Raised when no DAO class is found for a domain type rather than for a concrete

NoDAOFoundForSelectionError

Raised when none of the selected expressions of a query resolve to a DAO-bearing

NoDAOFoundDuringParsingError

Represents an error raised when no DAO (Data Access Object) class is found for a

UnsupportedRelationshipError

Raised when a relationship direction is not supported by the ORM mapping.

UncallableFunction

Exception raised when anonymous functions are reconstructed and then called.

UnsupportedColumnType

Exception raised when a column type is neither a type_mapping nor a builtin

Module Contents#

exception krrood.ormatic.exceptions.NoGenericError#

Bases: krrood.exceptions.DataclassException, TypeError

Exception raised when the original class for a DataAccessObject subclass cannot be determined.

This exception is typically raised when a DataAccessObject subclass has not been parameterized properly, which prevents identifying the original class associated with it.

clazz: Type#
error_message() str#
Returns:

A human-readable description of what went wrong.

suggest_correction() str#
Returns:

Advice on how to fix the error, or an empty string if there is no specific advice.

exception krrood.ormatic.exceptions.NoDAOFoundError#

Bases: krrood.exceptions.DataclassException, TypeError

Represents an error raised when no DAO (Data Access Object) class is found for a given class.

This exception is typically used when an attempt to convert a class into a corresponding DAO fails. It provides information about the class and the DAO involved.

obj: Any#

The class that no dao was found for

error_message() str#
Returns:

A human-readable description of what went wrong.

suggest_correction() str#
Returns:

Advice on how to fix the error, or an empty string if there is no specific advice.

exception krrood.ormatic.exceptions.NoDAOFoundForTypeError#

Bases: NoDAOFoundError

Raised when no DAO class is found for a domain type rather than for a concrete instance.

Type-driven lookups (such as EQL translation, which resolves DAOs from variable types) store the offending type itself in obj, so the message reports it directly instead of its metaclass.

error_message() str#
Returns:

A human-readable description of what went wrong.

exception krrood.ormatic.exceptions.NoDAOFoundForSelectionError#

Bases: NoDAOFoundError

Raised when none of the selected expressions of a query resolve to a DAO-bearing type.

error_message() str#
Returns:

A human-readable description of what went wrong.

exception krrood.ormatic.exceptions.NoDAOFoundDuringParsingError#

Bases: NoDAOFoundError

Represents an error raised when no DAO (Data Access Object) class is found for a given class.

This exception is typically used when an attempt to convert a class into a corresponding DAO fails. It provides information about the class and the DAO involved.

dao: Type#

The DAO class that tried to convert the cls to a DAO if any.

relationship: sqlalchemy.orm.RelationshipProperty#

The relationship that tried to create the DAO.

error_message() str#
Returns:

A human-readable description of what went wrong.

exception krrood.ormatic.exceptions.UnsupportedRelationshipError#

Bases: krrood.exceptions.DataclassException, ValueError

Raised when a relationship direction is not supported by the ORM mapping.

This error indicates that the relationship configuration could not be interpreted into a domain mapping.

relationship: sqlalchemy.orm.RelationshipProperty#
error_message() str#
Returns:

A human-readable description of what went wrong.

suggest_correction() str#
Returns:

Advice on how to fix the error, or an empty string if there is no specific advice.

exception krrood.ormatic.exceptions.UncallableFunction#

Bases: NotImplementedError

Exception raised when anonymous functions are reconstructed and then called.

function_mapping: krrood.ormatic.data_access_objects.alternative_mappings.FunctionMapping#

The mapping that was used to reconstruct the function.

exception krrood.ormatic.exceptions.UnsupportedColumnType#

Bases: krrood.exceptions.DataclassException, TypeError

Exception raised when a column type is neither a type_mapping nor a builtin sqlalchemy type.

column_type: Type#
error_message() str#
Returns:

A human-readable description of what went wrong.

suggest_correction() str#
Returns:

Advice on how to fix the error, or an empty string if there is no specific advice.