28 lines
800 B
Python
28 lines
800 B
Python
|
|
"""
|
||
|
|
Domain-specific exceptions for project management.
|
||
|
|
"""
|
||
|
|
|
||
|
|
|
||
|
|
class ProjectDomainError(Exception):
|
||
|
|
"""Base exception for project domain errors."""
|
||
|
|
|
||
|
|
def __init__(self, message: str, project_name: str = None):
|
||
|
|
super().__init__(message)
|
||
|
|
self.project_name = project_name
|
||
|
|
|
||
|
|
|
||
|
|
class ProjectValidationError(ProjectDomainError):
|
||
|
|
"""Exception raised when project validation fails."""
|
||
|
|
|
||
|
|
def __init__(self, message: str, field: str = None, value=None):
|
||
|
|
super().__init__(message)
|
||
|
|
self.field = field
|
||
|
|
self.value = value
|
||
|
|
|
||
|
|
|
||
|
|
class MilestoneError(ProjectDomainError):
|
||
|
|
"""Exception raised when milestone operations fail."""
|
||
|
|
|
||
|
|
def __init__(self, message: str, milestone_id: int = None):
|
||
|
|
super().__init__(message)
|
||
|
|
self.milestone_id = milestone_id
|