aeat.domain.deadlines._errors module

Domain errors for the aeat.domain.deadlines subpackage.

Every error inherits from aeat.core.errors.AeatError so callers have a single root they can catch when integrating with the deadline engine.

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

Bases: AeatError

Base class for every error raised by aeat.domain.deadlines.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

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

Bases: DeadlineError

Raised when an aeat.domain.deadlines.TaxpayerProfile cannot be loaded or validated.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

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

Bases: DeadlineError

Raised when the engine cannot produce a valid schedule.

Often caused by a mismatch between the requested year and the registry’s coverage, or by profile facts that trigger an unknown modelo.

Two structurally distinct failure classes share this type: the benign “no registry deadline windows registered” data gap — raised as the NoDeadlineWindowsError subclass so callers can degrade gracefully around it — and genuine registry-integrity faults (validation failure, profile-condition evaluation failure), raised as the bare ScheduleComputationError. A caller that wants the benign degradation must catch the narrow NoDeadlineWindowsError, never the broad base, so a genuine fault propagates instead of being masked.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

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

Bases: ScheduleComputationError

Raised when the registry has no deadline windows for a year/modelo.

This is the benign schedule-computation failure: a registry-track data gap (the Modelo 100 / 303 / 347 / 202 windows not yet registered — round-3 finding R1), not a corrupt or invalid registry. The overview calendar / agenda / explain surfaces catch this narrow subtype to degrade gracefully — a year or modelo with no window data contributes zero entries while the surface still answers for everything that does have data.

It is deliberately distinct from the bare ScheduleComputationError, which the engine raises for a genuine registry-integrity fault (validation failure, profile-condition evaluation failure). Catching only this subtype lets those genuine faults propagate and surface instead of being silently swallowed.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

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

Bases: DeadlineError, ValueError

Raised when deadline records violate state or shape invariants.

Inherits from ValueError to maintain compatibility with Pydantic validators.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]