aeat.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, suggestion=None, translated_message=None)[source]

Bases: CoreError, ValueError

Raised when an aggregation service composition invariant is violated.

Inherits from ValueError so pydantic field and model validators surface it through ValidationError without special handling. Inherits from CoreError so it participates in the central error registry and build_error_envelope.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationError(message, *, context=None, suggestion=None)[source]

Bases: AeatError

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:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationPeriodError(message, *, context=None, suggestion=None)[source]

Bases: AggregationError

Raised when a requested filing period cannot be parsed unambiguously.

Parameters:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationUnsupportedModeloError(message, *, context=None, suggestion=None)[source]

Bases: AggregationError

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

Parameters:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationMissingClassificationError(message, *, context=None, suggestion=None)[source]

Bases: AggregationError

Raised when in-period transactions still need business classification.

Parameters:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationCategoryCoverageError(message, *, context=None, suggestion=None)[source]

Bases: AggregationError

Raised when a business transaction lacks category or profile coverage.

Parameters:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AggregationValidationError(message, *, context=None, suggestion=None)[source]

Bases: AggregationError, CoreValidationError

Raised on invalid aggregation payload or state.

Inherits from CoreValidationError (which itself inherits from CoreError and ValueError) to participate in the shared CoreValidationError catch surface and remain compatible with pydantic field validators.

Parameters:
  • message (tr)

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

  • suggestion (str | None)

Return type:

None

code: ClassVar[ErrorCode]
t(message)[source]

Build a multilingual core.i18n.Translatable message payload.

Parameters:

message (str) – The translation key.

Return type:

Translatable

Returns:

A core.i18n.Translatable marker for the key.