Mountain/Error/mod.rs
1//! # Error Handling System
2//!
3//! This module provides a centralized error handling framework for Mountain.
4//! It eliminates inconsistent error handling across the codebase and provides
5//! a consistent, type-safe approach to error management.
6//!
7//! ## Architecture
8//!
9//! The Error module is organized into focused, atomic modules:
10//!
11//! - **CoreError**: Base error types and traits
12//! - **IPCError**: IPC-specific error types
13//! - **FileSystemError**: File system operation errors
14//! - **ConfigurationError**: Configuration management errors
15//! - **ServiceError**: Service-related errors
16//! - **ProviderError**: Provider-specific errors
17//!
18//! ## Design Principles
19//!
20//! 1. **Single Responsibility**: Each error type has one clear category
21//! 2. **Reusability**: Common error patterns are shared
22//! 3. **Type Safety**: Strong typing prevents common errors
23//! 4. **Rich Context**: Errors carry detailed context for debugging
24//!
25//! ## Example Usage
26//!
27//! ```rust
28//! use crate::Error::{
29//! CoreError,
30//! CoreError::{ErrorContext, ErrorSeverity},
31//! FileSystemError,
32//! IPCError,
33//! };
34//!
35//! let error = IPCError::ConnectionFailed {
36//! context:ErrorContext::new("Failed to connect to IPC server"),
37//! source:None,
38//! };
39//! ```
40
41pub mod CoreError;
42pub mod FileSystemError;
43pub mod IPCError;
44pub mod ConfigurationError;
45pub mod ServiceError;
46pub mod ProviderError;
47
48// Re-export commonly used error types from CoreError
49pub use CoreError::{ErrorContext, ErrorKind, ErrorSeverity, MountainError};
50// Error types are available through their modules: Error::FileSystemError,
51// Error::IPCError, etc.