Skip to main content

autonomic_core/
error.rs

1//! Error types for the Autonomic homeostasis controller.
2
3use thiserror::Error;
4
5/// Top-level error type for the Autonomic system.
6#[derive(Debug, Error)]
7pub enum AutonomicError {
8    /// A rule evaluation failed.
9    #[error("rule evaluation failed: {0}")]
10    RuleEvaluation(String),
11
12    /// Projection state is stale or missing.
13    #[error("projection not found for session: {0}")]
14    ProjectionNotFound(String),
15
16    /// Serialization/deserialization error.
17    #[error("serialization error: {0}")]
18    Serialization(#[from] serde_json::Error),
19
20    /// Event store interaction failed.
21    #[error("event store error: {0}")]
22    EventStore(String),
23
24    /// Configuration error.
25    #[error("configuration error: {0}")]
26    Config(String),
27}
28
29pub type AutonomicResult<T> = Result<T, AutonomicError>;