"""Wizard error hierarchy.Every wizard error inherits from :class:`AeatError` so callers cancatch the package-wide base class to handle every aeat domain erroruniformly. Each concrete subclass is bound to an :class:`ErrorCode`in the application error registry."""from__future__importannotationsfrom...core.errorsimportAeatError,CoreValidationError,ProfileAnswerTypeError
[docs]classWizardError(AeatError):"""Base class for every wizard error."""
[docs]classWizardValidationError(WizardError,CoreValidationError):"""Raised when a widget-level validator rejects an answer. Inherits from CoreValidationError (which itself inherits from CoreError and ValueError) to participate in the shared CoreValidationError catch surface and remain compatible with pydantic field validators. """
[docs]classWizardScriptUnderflowError(WizardError):"""Raised when a ``ScriptedPrompter`` is asked for more answers than it carries."""
[docs]classWizardScriptOverflowError(WizardError):"""Raised when a ``ScriptedPrompter`` is closed with unconsumed scripted answers."""
[docs]classWizardMissingFlagError(WizardError):"""Raised when a ``--quiet`` invocation omits a required-and-not-conditional question."""
[docs]classWizardCompileError(WizardError):"""Raised when ``compile_profile_keys`` rejects a malformed wizard catalogue."""
[docs]classWizardAnswerTypeError(ProfileAnswerTypeError):"""Raised when a :class:`SetupAnswers` field coercion receives an unexpected type. Each ``@field_validator`` in :mod:`aeat.core.setup_answers`'s :class:`SetupAnswers` raises :class:`~aeat.core.errors.ProfileAnswerTypeError` (the canonical core type); this subclass is retained so application-layer code and tests that catch :class:`WizardAnswerTypeError` by name continue to work. Inherits from :class:`~aeat.core.errors.ProfileAnswerTypeError` (which inherits from :class:`CoreValidationError` and :class:`ValueError`) to remain compatible with pydantic's field-validator contract while exposing a typed exception in the error registry. """