vgtc-api / src /hermes /core /exceptions.py
vora-sonnet's picture
Upload folder using huggingface_hub
0d3f7cc verified
Raw
History Blame Contribute Delete
1.89 kB
"""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."""