Expand description
Centralized error handling system
§Error Handling System
This module provides a centralized error handling framework for Mountain. It eliminates inconsistent error handling across the codebase and provides a consistent, type-safe approach to error management.
§Architecture
The Error module is organized into focused, atomic modules:
- CoreError: Base error types and traits
- IPCError: IPC-specific error types
- FileSystemError: File system operation errors
- ConfigurationError: Configuration management errors
- ServiceError: Service-related errors
- ProviderError: Provider-specific errors
§Design Principles
- Single Responsibility: Each error type has one clear category
- Reusability: Common error patterns are shared
- Type Safety: Strong typing prevents common errors
- Rich Context: Errors carry detailed context for debugging
§Example Usage
use crate::Error::{
CoreError,
CoreError::{ErrorContext, ErrorSeverity},
FileSystemError,
IPCError,
};
let error = IPCError::ConnectionFailed {
context:ErrorContext::new("Failed to connect to IPC server"),
source:None,
};Re-exports§
pub use CoreError::ErrorContext;pub use CoreError::ErrorKind;pub use CoreError::ErrorSeverity;pub use CoreError::MountainError;
Modules§
- Configuration
Error - Configuration Error Types
- Core
Error - Core Error Types
- File
System Error - File System Error Types
- IPCError
- IPC Error Types
- Provider
Error - Provider Error Types
- Service
Error - Service Error Types