aether_core/
error.rs

1//! Error types for Aether Core.
2
3use thiserror::Error;
4
5/// Result type alias for Aether operations.
6pub type Result<T> = std::result::Result<T, AetherError>;
7
8/// Main error type for the Aether framework.
9#[derive(Debug, Error)]
10pub enum AetherError {
11    /// Template parsing failed.
12    #[error("Template parse error: {0}")]
13    TemplateParse(String),
14
15    /// Slot not found in template.
16    #[error("Slot '{0}' not found in template")]
17    SlotNotFound(String),
18
19    /// AI provider returned an error.
20    #[error("AI provider error: {0}")]
21    ProviderError(String),
22
23    /// Network request failed.
24    #[error("Network error: {0}")]
25    NetworkError(String),
26
27    /// Code injection failed.
28    #[error("Injection error: {0}")]
29    InjectionError(String),
30
31    /// Invalid configuration.
32    #[error("Configuration error: {0}")]
33    ConfigError(String),
34
35    /// Template rendering failed.
36    #[error("Render error: {0}")]
37    RenderError(String),
38
39    /// IO operation failed.
40    #[error("IO error: {0}")]
41    IoError(#[from] std::io::Error),
42
43    /// JSON serialization/deserialization failed.
44    #[error("JSON error: {0}")]
45    JsonError(#[from] serde_json::Error),
46
47    /// Timeout occurred.
48    #[error("Operation timed out after {0} seconds")]
49    Timeout(u64),
50}