Module Error

Module Error 

Source
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

  1. Single Responsibility: Each error type has one clear category
  2. Reusability: Common error patterns are shared
  3. Type Safety: Strong typing prevents common errors
  4. 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§

ConfigurationError
Configuration Error Types
CoreError
Core Error Types
FileSystemError
File System Error Types
IPCError
IPC Error Types
ProviderError
Provider Error Types
ServiceError
Service Error Types