This document specifies the Application Programming Interface (API) for the Exceptions module. This module provides a comprehensive, hierarchical error handling system for the entire Codomyrmex ecosystem. All exceptions inherit from a single root class (CodomyrmexError) and are organized into domain-specific categories across 12 source files.
- Description: The root exception class for all Codomyrmex-related errors. Provides a consistent interface with structured context information, error codes, and serialization support. All other project exceptions inherit from this class.
- Module:
codomyrmex.exceptions.base - Inherits:
Exception - Parameters/Arguments (constructor):
message(str): The error messagecontext(dict[str, Any] | None, optional): Additional context information about the error. Defaults to{}error_code(str | None, optional): A unique error code. Defaults to the class name**kwargs(Any): Additional keyword arguments merged intocontext
- Attributes:
message(str): The error messagecontext(dict[str, Any]): Structured context dictionaryerror_code(str): Error code identifier (defaults to class name)
- Methods:
__str__() -> str: Returns formatted string[error_code] message (Context: key=value, ...).to_dict() -> dict[str, Any]: Serializes the exception to a dictionary with keyserror_type,error_code,message, andcontext.
- Description: Formats an exception chain for display, walking the
__cause__and__context__chain and returning a newline-separated string of formatted error messages. - Module:
codomyrmex.exceptions.base - Parameters/Arguments:
exception(Exception): The exception to format
- Returns/Response:
str- A formatted string representation of the full exception chain.
- Description: Utility function to create a context dictionary for exception handling. Filters out
Nonevalues automatically. - Module:
codomyrmex.exceptions.base - Parameters/Arguments:
**kwargs(Any): Key-value pairs to include in the context
- Returns/Response:
dict[str, Any]- A dictionary with all non-None values.
- Inherits:
CodomyrmexError - Description: Raised when there is an issue with configuration settings.
- Additional Parameters:
config_key(str | None, optional): The configuration key that caused the errorconfig_file(str | Path | None, optional): Path to the configuration file
- Inherits:
CodomyrmexError - Description: Raised when the environment is not properly set up.
- Inherits:
CodomyrmexError - Description: Raised when a required dependency is missing or incompatible.
- Inherits:
CodomyrmexError - Description: Raised when file operations fail.
- Additional Parameters:
file_path(str | Path | None, optional): Path to the file that caused the error
- Inherits:
CodomyrmexError - Description: Raised when directory operations fail.
- Inherits:
CodomyrmexError - Description: Raised when AI provider operations fail.
- Inherits:
CodomyrmexError - Description: Raised when code generation fails.
- Inherits:
CodomyrmexError - Description: Raised when code editing operations fail.
- Inherits:
CodomyrmexError - Description: Raised when model context protocol operations fail.
- Inherits:
CodomyrmexError - Description: Raised when static analysis operations fail.
- Inherits:
CodomyrmexError - Description: Raised when pattern matching operations fail.
- Inherits:
CodomyrmexError - Description: Raised when security audit operations fail.
- Inherits:
CodomyrmexError - Description: Raised when code execution fails.
- Additional Parameters:
exit_code(int | None, optional): Process exit codestdout(str | None, optional): Captured standard outputstderr(str | None, optional): Captured standard error
- Inherits:
CodomyrmexError - Description: Raised when sandbox operations fail.
- Inherits:
CodomyrmexError - Description: Raised when container operations fail.
- Inherits:
CodomyrmexError - Description: Raised when build operations fail.
- Inherits:
CodomyrmexError - Description: Raised when code synthesis operations fail.
- Inherits:
CodomyrmexError - Description: Raised when git operations fail.
- Additional Parameters:
git_command(str | None, optional): The git command that failedrepository_path(str | Path | None, optional): Path to the repository
- Inherits:
CodomyrmexError - Description: Raised when repository operations fail.
- Inherits:
CodomyrmexError - Description: Raised when data visualization operations fail.
- Inherits:
CodomyrmexError - Description: Raised when plotting operations fail.
- Inherits:
CodomyrmexError - Description: Raised when documentation operations fail.
- Inherits:
CodomyrmexError - Description: Raised when API documentation generation fails.
- Inherits:
CodomyrmexError - Description: Raised when orchestration operations fail.
- Inherits:
CodomyrmexError - Description: Raised when workflow execution fails.
- Inherits:
CodomyrmexError - Description: Raised when project management operations fail.
- Inherits:
CodomyrmexError - Description: Raised when task execution fails.
- Inherits:
CodomyrmexError - Description: Raised when network operations fail.
- Additional Parameters:
url(str | None, optional): The URL that caused the errorstatus_code(int | None, optional): HTTP status code
- Inherits:
CodomyrmexError - Description: Raised when API operations fail.
- Inherits:
CodomyrmexError - Description: Raised when data validation fails.
- Additional Parameters:
field_name(str | None, optional): The field that failed validationvalidation_rule(str | None, optional): The rule that was violated
- Inherits:
CodomyrmexError - Description: Raised when schema validation fails.
- Inherits:
CodomyrmexError - Description: Raised when operations timeout.
- Additional Parameters:
timeout_seconds(float | None, optional): The timeout duration that was exceeded
- Inherits:
CodomyrmexError - Description: Base exception class for all CEREBRUM cognitive system errors.
- Inherits:
CerebrumError - Description: Exception raised for case-related errors.
- Inherits:
CaseError - Description: Exception raised when a case is not found.
- Inherits:
CaseError - Description: Exception raised when a case is invalid.
- Inherits:
CerebrumError - Description: Exception raised for Bayesian inference errors.
- Inherits:
BayesianInferenceError - Description: Exception raised when inference fails.
- Inherits:
BayesianInferenceError - Description: Exception raised when Bayesian network structure is invalid.
- Inherits:
CerebrumError - Description: Exception raised for active inference errors.
- Inherits:
CerebrumError - Description: Exception raised for model-related errors.
- Inherits:
CerebrumError - Description: Exception raised for model transformation errors.
PerformanceError(inheritsCodomyrmexError): Raised when performance monitoring operations fail.LoggingError(inheritsCodomyrmexError): Raised when logging operations fail.
SystemDiscoveryError(inheritsCodomyrmexError): Raised when system discovery operations fail.CapabilityScanError(inheritsCodomyrmexError): Raised when capability scanning fails.
Modeling3DError(inheritsCodomyrmexError): Raised when 3D modeling operations fail.PhysicalManagementError(inheritsCodomyrmexError): Raised when physical management operations fail.SimulationError(inheritsCodomyrmexError): Raised when simulation operations fail.
TerminalError(inheritsCodomyrmexError): Raised when terminal interface operations fail.InteractiveShellError(inheritsCodomyrmexError): Raised when interactive shell operations fail.
DatabaseError(inheritsCodomyrmexError): Raised when database operations fail.
CICDError(inheritsCodomyrmexError): Raised when CI/CD operations fail.DeploymentError(inheritsCodomyrmexError): Raised when deployment operations fail.
ResourceError(inheritsCodomyrmexError): Raised when resource operations fail.MemoryError(inheritsCodomyrmexError): Raised when memory-related errors occur.
SpatialError(inheritsCodomyrmexError): Raised when spatial operations fail.EventError(inheritsCodomyrmexError): Raised when event processing fails.
SkillError(inheritsCodomyrmexError): Raised when skill execution fails.TemplateError(inheritsCodomyrmexError): Raised when template operations fail.
PluginError(inheritsCodomyrmexError): Raised when plugin operations fail.- Additional Parameters:
plugin_name(str | None, optional): Name of the pluginplugin_version(str | None, optional): Version of the plugin
AuthenticationError(inheritsCodomyrmexError): Raised when authentication fails.
CircuitOpenError(inheritsException): Raised when the circuit breaker is open. Note: does NOT inherit fromCodomyrmexError.BulkheadFullError(inheritsException): Raised when the bulkhead semaphore is exhausted. Note: does NOT inherit fromCodomyrmexError.
CompressionError(inheritsCodomyrmexError): Raised when compression operations fail.EncryptionError(inheritsCodomyrmexError): Raised when encryption operations fail.
IDEError(inheritsCodomyrmexError): Base exception for IDE-related errors.IDEConnectionError(inheritsIDEError): Raised when IDE connection fails.CommandExecutionError(inheritsIDEError): Raised when an IDE command fails to execute.SessionError(inheritsIDEError): Raised when there is a session-related error.ArtifactError(inheritsIDEError): Raised when artifact operations fail.
CacheError(inheritsCodomyrmexError): Raised when cache operations fail.- Additional Parameters:
cache_key(str | None, optional): The cache key that caused the errorbackend(str | None, optional): The cache backend in use
SerializationError(inheritsCodomyrmexError): Raised when serialization/deserialization operations fail.- Additional Parameters:
format_type(str | None, optional): The serialization format (e.g., "json", "yaml")data_type(str | None, optional): The type of data being serialized
All exceptions support serialization via the to_dict() method inherited from CodomyrmexError:
{
"error_type": "FileOperationError",
"error_code": "FileOperationError",
"message": "Cannot read file",
"context": {"file_path": "/path/to/file.txt"}
}Exception
+-- CodomyrmexError (base.py)
| +-- ConfigurationError (config.py)
| +-- EnvironmentError (config.py)
| +-- DependencyError (config.py)
| +-- FileOperationError (io.py)
| +-- DirectoryError (io.py)
| +-- AIProviderError (ai.py)
| +-- CodeGenerationError (ai.py)
| +-- CodeEditingError (ai.py)
| +-- ModelContextError (ai.py)
| +-- StaticAnalysisError (analysis.py)
| +-- PatternMatchingError (analysis.py)
| +-- SecurityAuditError (analysis.py)
| +-- CodeExecutionError (execution.py)
| +-- SandboxError (execution.py)
| +-- ContainerError (execution.py)
| +-- BuildError (execution.py)
| +-- SynthesisError (execution.py)
| +-- GitOperationError (git.py)
| +-- RepositoryError (git.py)
| +-- VisualizationError (viz.py)
| +-- PlottingError (viz.py)
| +-- DocumentationError (viz.py)
| +-- APIDocumentationError (viz.py)
| +-- OrchestrationError (orchestration.py)
| +-- WorkflowError (orchestration.py)
| +-- ProjectManagementError (orchestration.py)
| +-- TaskExecutionError (orchestration.py)
| +-- NetworkError (network.py)
| +-- APIError (network.py)
| +-- ValidationError (network.py)
| +-- SchemaError (network.py)
| +-- TimeoutError (network.py)
| +-- CerebrumError (cerebrum.py)
| | +-- CaseError
| | | +-- CaseNotFoundError
| | | +-- InvalidCaseError
| | +-- BayesianInferenceError
| | | +-- InferenceError
| | | +-- NetworkStructureError
| | +-- ActiveInferenceError
| | +-- ModelError
| | +-- TransformationError
| +-- PerformanceError (specialized.py)
| +-- LoggingError (specialized.py)
| +-- SystemDiscoveryError (specialized.py)
| +-- ... (30+ more specialized exceptions)
| +-- IDEError (specialized.py)
| +-- IDEConnectionError
| +-- CommandExecutionError
| +-- SessionError
| +-- ArtifactError
+-- CircuitOpenError (specialized.py)
+-- BulkheadFullError (specialized.py)
Not applicable for this internal exception module.
Not applicable for this internal exception module.
This module follows the general versioning strategy of the Codomyrmex project. API stability is aimed for, with changes documented in the CHANGELOG.md.
- Parent: Project Overview
- Module Index: All Agents
- Documentation: Reference Guides
- Home: Root README