cadrumo.domain.deadlines.errors module

Canonical domain errors for the cadrumo.domain.deadlines subpackage.

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

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

Bases: CadrumoError

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

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: DeadlineError

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

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception ScheduleComputationError(message=None, *, context=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)

  • translated_message (str | None)

Return type:

None

code
exception NoDeadlineWindowsError(message=None, *, context=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), 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)

  • translated_message (str | None)

Return type:

None

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

Bases: DeadlineError

Raised when deadline records violate state or shape invariants.

Its canonical registered ancestry is DeadlineError. Pydantic validators translate this registered failure to ValueError at their narrow boundary.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code