| 123456789101112131415161718192021222324252627282930313233 |
- """Standardized error types for the Crypto MCP server."""
- class CryptoMCPError(Exception):
- """Base error."""
- code: str = "INTERNAL_ERROR"
- def to_dict(self) -> dict:
- return {"error": self.code, "detail": str(self)}
- class SymbolNotFoundError(CryptoMCPError):
- code = "SYMBOL_NOT_FOUND"
- class ProviderError(CryptoMCPError):
- code = "PROVIDER_ERROR"
- class InsufficientDataError(CryptoMCPError):
- code = "INSUFFICIENT_DATA"
- class InvalidParamsError(CryptoMCPError):
- code = "INVALID_PARAMS"
- class UnsupportedIndicatorError(CryptoMCPError):
- code = "UNSUPPORTED_INDICATOR"
- class UnsupportedTimeframeError(CryptoMCPError):
- code = "UNSUPPORTED_TIMEFRAME"
|