from __future__ import annotations


class MockMeshError(Exception):
    pass


class InterceptError(MockMeshError):

    def __init__(self, provider: str, operation: str, cause: Exception) -> None:
        self.provider = provider
        self.operation = operation
        self.cause = cause
        super().__init__(
            f"MockMesh interceptor error [{provider}/{operation}]: {cause}"
        )


class UnknownOperationError(InterceptError):

    def __init__(self, provider: str, operation: str) -> None:
        super().__init__(
            provider,
            operation,
            cause=ValueError(f"Unknown operation: {operation}"),
        )
