"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

Mirrors `targets::rust`'s `McpifyError` hierarchy: one exception class per
error family, each carrying the literal `code` string callers match on
instead of branching on the exception's Python type.
"""

from __future__ import annotations

from typing import Any


class McpifyError(Exception):
    """Base class for every error this project raises deliberately."""

    code: str = "MCPIFY_ERROR"


class ConfigurationError(McpifyError):
    code = "CONFIGURATION_ERROR"


class AuthenticationError(McpifyError):
    code = "AUTHENTICATION_ERROR"


class ValidationError(McpifyError):
    code = "VALIDATION_ERROR"

    def __init__(self, message: str, details: Any | None = None) -> None:
        super().__init__(message)
        self.details = details


class NotFoundError(McpifyError):
    code = "NOT_FOUND"


class CircuitBreakerOpenError(McpifyError):
    code = "CIRCUIT_BREAKER_OPEN"

    def __init__(self) -> None:
        super().__init__("circuit breaker is open")


class RateLimitExceededError(McpifyError):
    code = "RATE_LIMIT_EXCEEDED"

    def __init__(self) -> None:
        super().__init__("rate limit exceeded")
