cadrumo.domain.iva.errors module

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

Every failure mode raised by the IVA substrate inherits from IvaError, which in turn inherits from cadrumo.core.errors.hierarchy.CadrumoError. Downstream callers catch the base class when they want to treat the substrate as an opaque unit, or the specific subclass when they need to distinguish missing-rate from missing-category or corpus load failures.

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

Bases: CadrumoError

Base error for every cadrumo.domain.iva failure mode.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: IvaError

Raised when cadrumo.domain.iva.lookup.lookup_rate() cannot resolve a rate.

The lookup fails either because the requested member state is absent from cadrumo.domain.iva.rates.load_iva_rate_table(), because no rate of the requested cadrumo.domain.iva.schema.IvaRateKind is registered for that member state, or because every registered rate’s effective window excludes the requested date.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: IvaError

Raised when a lookup against a resolved IVA catalogue misses.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: IvaError

Raised when an IVA catalogue cannot be loaded, resolved, or validated.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: IvaError

Raised when two cadrumo.domain.iva.schema.IvaRateRecord records share a window.

The substrate enforces that for every (member_state, kind) partition of cadrumo.domain.iva.rates.load_iva_rate_table() no two records have overlapping effective_from / effective_until ranges. Adding a new record that violates this invariant raises this error at module import time so the regression surfaces in CI rather than silently affecting cadrumo.domain.iva.lookup.lookup_rate() results.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: IvaError

Raised on invalid IVA field values.

Its canonical registered ancestry is IvaError. 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
exception ProrrataError(message=None, *, context=None, translated_message=None)[source]

Bases: IvaError

Base error for IVA prorrata calculation failures (LIVA arts. 101-103).

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

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

Bases: ProrrataError

Raised when prorrata inputs violate domain invariants.

Its canonical registered ancestry is ProrrataError. Pydantic model 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