33 lines
1010 B
Python
33 lines
1010 B
Python
"""Domain exceptions for the minimal component registry."""
|
|
|
|
|
|
class ComponentError(Exception):
|
|
"""Base exception for component operations."""
|
|
|
|
|
|
class ComponentNotFound(ComponentError):
|
|
"""Raised when a component UUID does not exist."""
|
|
|
|
def __init__(self, component_id: object):
|
|
self.component_id = component_id
|
|
super().__init__(f"Component not found: {component_id}")
|
|
|
|
|
|
class DuplicateComponentAssetID(ComponentError):
|
|
"""Raised when a normalized component Asset ID already exists."""
|
|
|
|
def __init__(self, asset_id: str):
|
|
self.asset_id = asset_id
|
|
super().__init__(f"Component Asset ID already exists: {asset_id}")
|
|
|
|
|
|
class ComponentValidationError(ComponentError):
|
|
"""Raised when component metadata violates a domain rule."""
|
|
|
|
|
|
class ComponentActorRequired(ComponentError):
|
|
"""Raised when component creation lacks an authenticated actor."""
|
|
|
|
def __init__(self):
|
|
super().__init__("An authenticated actor is required to create a component")
|