Spaces:
Paused
Paused
File size: 1,889 Bytes
0d3f7cc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | """Core exception definitions."""
from __future__ import annotations
class HermesError(Exception):
"""Base exception for the Hermes platform."""
def __init__(self, message: str, details: dict | None = None) -> None:
super().__init__(message)
self.message = message
self.details = details or {}
class AgentError(HermesError):
"""Error in agent execution."""
class ToolError(HermesError):
"""Error in tool execution."""
class ToolNotFoundError(ToolError):
"""Tool not found in registry."""
def __init__(self, tool_name: str) -> None:
super().__init__(f"Tool '{tool_name}' not found")
class ToolTimeoutError(ToolError):
"""Tool execution timed out."""
def __init__(self, tool_name: str, timeout: float) -> None:
super().__init__(f"Tool '{tool_name}' timed out after {timeout}s")
class MCPError(HermesError):
"""MCP protocol error."""
class MCPConnectionError(MCPError):
"""MCP server connection error."""
class MCPToolError(MCPError):
"""MCP tool execution error."""
class MemoryError(HermesError): # noqa: A001
"""Memory system error."""
class StorageError(HermesError):
"""Storage backend error."""
class EmbeddingError(HermesError):
"""Embedding generation error."""
class ConfigurationError(HermesError):
"""Configuration error."""
class WorkflowError(HermesError):
"""Workflow execution error."""
class WorkflowTimeoutError(WorkflowError):
"""Workflow execution timed out."""
class ResearchError(HermesError):
"""Research task error."""
class AnalysisError(HermesError):
"""Code analysis error."""
class SecurityScanError(HermesError):
"""Security scan error."""
class ReportGenerationError(HermesError):
"""Report generation error."""
|