"""Error types for Aegis SDK"""


class AegisError(Exception):
    """Base Aegis error"""
    pass


class PolicyError(AegisError):
    """Policy validation error"""
    pass


class CapabilityBlockedError(AegisError):
    """Capability blocked error"""
    
    def __init__(self, capability: str, reason: str):
        self.capability = capability
        self.reason = reason
        super().__init__(f"Capability '{capability}' blocked: {reason}")


class ApprovalRequiredError(AegisError):
    """Approval required error"""
    
    def __init__(self, approval_id: str, capability: str):
        self.approval_id = approval_id
        self.capability = capability
        super().__init__(f"Capability '{capability}' requires approval: {approval_id}")


class TaintViolationError(AegisError):
    """Taint violation error"""
    
    def __init__(self, message: str, sources: list[str]):
        self.sources = sources
        super().__init__(message)


class NetworkError(AegisError):
    """Network error"""
    
    def __init__(self, message: str, status_code: int | None = None):
        self.status_code = status_code
        super().__init__(message)


class TraceVerificationError(AegisError):
    """Trace verification error"""
    pass
