"""Canonical flow-substrate error hierarchy.Every substrate error inherits from :class:`CadrumoError` so callerscatch the package-wide base class to handle every cadrumo domain erroruniformly. The substrate raises typed, translated errors only; rawoperator answers never ride in error context."""from__future__importannotationsfrom...core.errors.hierarchyimportCadrumoError,CoreValidationError
[docs]classFlowError(CadrumoError):"""Base class for every flow-substrate error."""
[docs]classFlowValidatorRegistryError(FlowError):"""Raised on a blank, duplicate, or unknown validator-id registration or lookup."""
[docs]classFlowNavigationError(FlowError):"""Raised when a navigation intent names a page the current state cannot reach."""
[docs]classFlowAnswerError(FlowError,CoreValidationError):"""Raised when an answer intent targets a page that cannot accept it. Inherits from :class:`CoreValidationError` to participate in the shared validation catch surface. """
[docs]classFlowSubmitError(FlowError):"""Raised when submission is attempted while the review gate refuses it."""
[docs]classFlowCheckpointError(FlowError):"""Raised when a checkpoint or resume operation cannot complete."""
[docs]classFlowCopyResolutionError(FlowError):"""Raised when a copy reference cannot be resolved against its declared source."""
[docs]classFlowRunAbandonedError(FlowError):"""Raised when the operator abandons a line-mode prompt loop (Ctrl-C). The line frontend prompts through ``unsafe_ask`` so a ``KeyboardInterrupt`` surfaces at the frontend boundary as a typed, translated refusal instead of being swallowed into a silent re-prompt with no cancel path. Context carries flow metadata only — never a raw operator answer. """
[docs]classFlowUnsupportedConsoleError(FlowError):"""Raised when the host terminal cannot host an interactive flow frontend. Surfaces when ``prompt_toolkit`` rejects the active TTY (typically ``NoConsoleScreenBufferError`` under git-bash on Windows) or stdin is not a TTY. Frontends catch this at their boundary and surface a translated operator-facing refusal, never a raw traceback. """