Source code for httk.workflow.errors
"""Define exceptions raised by :mod:`httk.workflow`."""
# Seal errors are owned by httk-core so isinstance checks agree across the
# boundary: workflow code that seals through core, and core code that raises
# on a workflow member, share one SealError / SealedError type.
from httk.core.project.sealing import SealedError, SealError
__all__ = [
"FormatError",
"ResolutionMiss",
"RunnerResolutionError",
"SealError",
"SealedError",
"TransactionError",
"TransitionLostError",
"UnsupportedExtensionError",
"WorkflowError",
"WorkspaceCorruptionError",
"WorkspaceUnavailableError",
]
[docs]
class WorkflowError(RuntimeError):
"""Base class for workflow protocol failures."""
[docs]
class ResolutionMiss(ValueError):
"""A name did not resolve, without indicating malformed configuration."""
[docs]
class WorkspaceUnavailableError(WorkflowError):
"""The workspace cannot currently provide a coherent protocol view."""
[docs]
class WorkspaceCorruptionError(WorkflowError):
"""The authoritative filesystem state is internally inconsistent."""
[docs]
class TransitionLostError(WorkflowError):
"""Another actor committed a transition from the expected marker."""
[docs]
class UnsupportedExtensionError(WorkflowError):
"""A workspace requires an extension this implementation does not support."""
[docs]
class TransactionError(WorkflowError):
"""A transactional-data manifest cannot be safely replayed."""
[docs]
class RunnerResolutionError(WorkflowError):
"""A shared runner cannot be resolved or verified.
The failure carries the exact protocol failure ``code`` the manager records,
so an unresolvable runner (``runner_unavailable``), a runner whose bytes
disagree with the digest the job pinned (``runner_mismatch``), a
missing registration (``runner_not_built``), and a failed foreground build
(``runner_build_failed``) stay distinguishable to an operator.
:param code: Protocol failure code recorded by the manager.
:param message: Human-readable failure description.
"""
def __init__(self, code: str, message: str) -> None:
super().__init__(message)