aeat.domain.contribuyente._errors module¶
Domain errors for the contribuyente tax-residence profile.
Defines TaxResidenceProfileError and its concrete failures
surfaced to RENTA verification, plus ProfileKeysRegistrationError
for the profile-key registry. The ledger error hierarchies live with their
records in domain.contribuyente.assets (asset) and
domain.contribuyente.inventory (inventory and amortizacion). Every
class derives from core.errors.AeatError so the shared
error-code registration hook applies.
- exception TaxResidenceProfileError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase 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 singleexceptclause.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ProfileNotConfiguredError[source]¶
Bases:
TaxResidenceProfileErrorRaised when RENTA verification needs a tax-residence profile.
Attached to a
suggestionpointing the operator at the profile edit wizard.- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ForalRegimeError(value)[source]¶
Bases:
TaxResidenceProfileErrorRaised 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: ClassVar[ErrorCode]¶
- exception ProfileValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
TaxResidenceProfileError,ValueErrorRaised when profile records violate state or shape invariants.
Inherits from ValueError to maintain compatibility with Pydantic validators.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ProfileKeysRegistrationError(message='profile keys already registered with a different tuple')[source]¶
Bases:
CoreErrorRaised on a profile-key registry invariant violation.
Two cases share this typed exception (registered once centrally): a second registration with a conflicting tuple (the registry is single-writer, first registration wins), or an access before any registration — a programming / import-order error meaning the wizard catalogue (
application.wizard) was not imported at startup to push the compiled keys viaregister_profile_keys(). Replaces a bareRuntimeErrorso callers can catch it precisely and the failure surfaces in the central registry.- Parameters:
message (str)
- Return type:
None
- code: ClassVar[ErrorCode]¶