cadrumo.application.wizard.errors module

Wizard error hierarchy.

Every wizard error inherits from CadrumoError so callers can catch the package-wide base class to handle every cadrumo domain error uniformly. Each concrete subclass is bound to an ErrorCode in the application error registry.

class WizardPreconditionCondition(*values)[source]

Bases: StrEnum

Stable terminal conditions observed by the wizard boundary.

ACTIVE_PROFILE_AVAILABLE
ACTIVE_PROFILE_TAX_ID_DECLARED
FILING_BASELINE_COMPLETE
REQUIRED_FLAGS_SUPPLIED
PROFILE_NAME_SUPPLIED
PROFILE_LABEL_AVAILABLE
INTERACTIVE_CONSOLE_AVAILABLE
wizard_no_action_verdict(*, condition, facts, provenance, outcome)[source]

Delegate one fact-only wizard terminal refusal to the public authority.

Parameters:
exception WizardError(message=None, *, context=None, translated_message=None, precondition_verdict=None)[source]

Bases: TerminalPreconditionErrorMixin[PreconditionVerdict], CadrumoError

Base class for every wizard error.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: WizardError, CoreValidationError

Raised when a widget-level validator rejects an answer.

Its registered ancestry includes CoreValidationError under the wizard error family. Pydantic field validators translate this registered failure to ValueError at their narrow boundary.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: WizardError

Raised when the host terminal cannot host the interactive setup wizard.

Raised at the CLI boundary wrapping the flow substrate’s console refusal. The terminal verdict records only the failed console capability; it does not invent a follow-on command from a host limitation.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: WizardUnsupportedConsoleError

No-console refusal raised specifically from the profile edit flow.

This subclass keeps the edit-specific registered error code while sharing the same factual terminal console-capability outcome as the base error.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: WizardError

Raised when a --quiet invocation omits a required-and-not-conditional question.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: WizardError

Raised when compile_profile_keys rejects a malformed wizard catalogue.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

  • precondition_verdict (VerdictT | None)

Return type:

None

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

Bases: ProfileAnswerTypeError

Raised when a SetupAnswers field coercion receives an unexpected type.

Each @field_validator in cadrumo.domain.user_profile.setup_answers’s SetupAnswers raises ProfileAnswerTypeError (the canonical core type); this subclass is retained so application-layer code and tests that catch WizardAnswerTypeError by name continue to work.

Inherits from the registered ProfileAnswerTypeError family, whose validation failures are translated to ValueError at the Pydantic field-validator boundary while this typed exception remains in the error registry.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code