krrood.entity_query_language.verbalization.exceptions#

Custom exceptions raised by the EQL verbalization subsystem.

Each is a DataclassException — a dataclass exception that carries the structured cause as fields and composes its human-readable message from error_message() / suggest_correction() — so the failure data is inspectable (not only a formatted string), consistent with the rest of krrood.

Exceptions#

PredicateFragmentRequiredError

A Verbalizable predicate was verbalized without

NonFragmentPredicateError

A predicate's _verbalization_fragment_ returned something that is not a

UnverbalizableExpressionError

No grammar rule covers an EQL construct — a coverage gap, surfaced as an error

UnloweredFragmentError

A fragment kind with no fold handler reached a renderer — a realisation pass was

UndeclaredFormPositionError

A concrete :class:`~krrood.entity_query_language.verbalization.grammar.conditions.pl

UnknownAggregatorError

An aggregator type has no verbalization phrase — a coverage gap surfaced when a new

AmbiguousRuleError

Two or more grammar rules (or specificity-ranked forms) are equally specific for the

Module Contents#

exception krrood.entity_query_language.verbalization.exceptions.PredicateFragmentRequiredError#

Bases: krrood.exceptions.DataclassException

A Verbalizable predicate was verbalized without implementing _verbalization_fragment_. A predicate must state its surface as a structured fragment clause (there is no name-based string fallback), so the omission is an error rather than a degraded “a HasHighSalary, where …” rendering.

node: krrood.entity_query_language.core.variable.InstantiatedVariable#

The instantiated predicate whose type supplies no verbalization fragment.

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.entity_query_language.verbalization.exceptions.NonFragmentPredicateError#

Bases: krrood.exceptions.DataclassException

A predicate’s _verbalization_fragment_ returned something that is not a VerbalizationFragment (e.g. a leftover format string).

Fragments are required so the surface composes with the realisation passes (negation, coreference, morphology).

predicate_type: type#

The predicate type whose hook returned a non-fragment.

returned: object#

The non-fragment value the hook returned.

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.entity_query_language.verbalization.exceptions.UnverbalizableExpressionError#

Bases: krrood.exceptions.DataclassException

No grammar rule covers an EQL construct — a coverage gap, surfaced as an error rather than silently degrading the node to its class name.

node: krrood.entity_query_language.core.base_expressions.SymbolicExpression#

The EQL expression no grammar rule matched.

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.entity_query_language.verbalization.exceptions.UnloweredFragmentError#

Bases: krrood.exceptions.DataclassException

A fragment kind with no fold handler reached a renderer — a realisation pass was skipped, leaving an un-lowered NounPhrase or PossessiveChain in the tree.

fragment: krrood.entity_query_language.verbalization.fragments.base.VerbalizationFragment#

The un-lowered fragment that reached the renderer.

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.entity_query_language.verbalization.exceptions.UndeclaredFormPositionError#

Bases: krrood.exceptions.DataclassException

A concrete ConditionForm subclass did not declare its position class variable — caught at class-definition time rather than as a silent AttributeError deep in place.

form: type[ConditionForm]#

The condition-form subclass missing its position.

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.entity_query_language.verbalization.exceptions.UnknownAggregatorError#

Bases: krrood.exceptions.DataclassException

An aggregator type has no verbalization phrase — a coverage gap surfaced when a new Aggregator subtype is added without a matching entry in Aggregations.

aggregator_type: type[Aggregator]#

The aggregator type that maps to no aggregation phrase.

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.entity_query_language.verbalization.exceptions.AmbiguousRuleError#

Bases: krrood.exceptions.DataclassException

Two or more grammar rules (or specificity-ranked forms) are equally specific for the same dispatch target — a collision that would otherwise resolve silently by registration order.

Surfaced as an error so an accidental overlap is caught rather than masked.

subject: object#

The expression or request being dispatched when the collision occurred.

candidates: list[type]#

The equally-specific rule/form classes that collided.

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.