cadrumo.application.aggregation.errors module

Errors raised while handling aggregation and source-mesh boundaries.

Raised by pure rollup modules such as iva_ledger, renta_ledger, retenciones, counterpart, and foreign_assets, and by source-mesh resolvers such as modelo_bindings and oss_ioss, when aggregation constraints or resolver ownership contracts are violated.

exception AggregationConfigError(message=None, *, context=None, translated_message=None)[source]

Bases: CoreError

Raised when an aggregation service composition invariant is violated.

Its canonical registered ancestry is CoreError, so it participates in the central error registry and build_error_envelope. Pydantic field and model validators translate it to ValueError at their narrow boundary.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
exception AggregationError(message, *, context=None, precondition_verdict=None)[source]

Bases: TerminalPreconditionErrorMixin[PreconditionVerdict], CadrumoError

Base class for financial transaction aggregation failures.

The translated_message field is a translation key resolved by the internationalization system at runtime. The same key is also routed through the positional message= arg so str(exc) returns the key (rather than the empty string) for diagnostic surfaces, structured logs, and operator error envelopes that render exceptions via str. Without this routing, every operator-facing display of an aggregation error showed the empty string.

Parameters:
Return type:

None

code
exception AggregationPeriodError(message, *, context=None, precondition_verdict=None)[source]

Bases: AggregationError

Raised when a requested filing period cannot be parsed unambiguously.

Parameters:
Return type:

None

code
exception AggregationUnsupportedModeloError(message, *, context=None, precondition_verdict=None)[source]

Bases: AggregationError

Raised when no aggregation contract is available for the requested modelo.

Parameters:
Return type:

None

code
exception AggregationMissingClassificationError(message, *, context=None, precondition_verdict=None)[source]

Bases: AggregationError

Raised when in-period transactions still need business classification.

Parameters:
Return type:

None

code
exception AggregationCategoryCoverageError(message, *, context=None, precondition_verdict=None)[source]

Bases: AggregationError

Raised when a business transaction lacks category or profile coverage.

Parameters:
Return type:

None

code
exception AggregationValidationError(message, *, context=None, precondition_verdict=None)[source]

Bases: AggregationError

Raised on invalid aggregation payload or state.

Its canonical registered ancestry is AggregationError under the application error registry. Pydantic field validators translate this registered failure to ValueError at their narrow boundary.

Parameters:
Return type:

None

code