Source code for dxaws_website.exceptions
"""Module-specific exceptions.
Keep exceptions stable once published. Callers may rely on these names
for control flow and error handling.
"""
[docs]
class DxAwsError(Exception):
"""Base error for dxaws-website."""
[docs]
class ValidationError(DxAwsError):
"""Raised when caller-provided desired state or arguments are invalid."""
[docs]
class ProviderError(DxAwsError):
"""Raised when the provider encounters an unexpected or unrecoverable error."""
[docs]
class PlanError(DxAwsError):
"""Raised when planning fails (e.g., inconsistent current state or diffing failure)."""
[docs]
class ApplyError(DxAwsError):
"""Raised when plan application fails."""
def __init__(self, message: str, *, stage: str | None = None, action: str | None = None):
super().__init__(message)
self.stage = stage
self.action = action
# -----------------------------------------------------------------------------
# Backward-compatible / expected names
# -----------------------------------------------------------------------------
# The executor and older drafts of this module use these names.
# Keep them as stable aliases so imports remain consistent.
WebsitePlanError = PlanError
WebsiteApplyError = ApplyError
DxAwsWebsiteError = DxAwsError