cadrumo.domain.contribuyente.errors module

Domain errors for the contribuyente tax-residence profile.

Defines TaxResidenceProfileError and its concrete failures surfaced to RENTA verification. The inventory ledger error hierarchy lives with its records in domain.contribuyente.inventory. Every class derives from core.errors.hierarchy.CadrumoError so the shared error-code registration hook applies.

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

Bases: CadrumoError

Base class for tax-residence profile failures.

Concrete subclasses (ProfileNotConfiguredError, ForalRegimeError) carry their own translated messages and suggestions; this base type exists only so callers can catch the family with a single except clause.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception ProfileNotConfiguredError[source]

Bases: TaxResidenceProfileError

Raised when RENTA verification needs a tax-residence profile.

Return type:

None

code
exception ForalRegimeError(value)[source]

Bases: TaxResidenceProfileError

Raised when the user selects a foral regime not modelled by this profile.

Variables:

value – The foral CCAA identifier supplied by the caller.

Parameters:

value (str)

Return type:

None

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

Bases: TaxResidenceProfileError

Raised when profile records violate state or shape invariants.

Its canonical registered ancestry is TaxResidenceProfileError. 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