Skip to main content

oxyde_core/
error.rs

1//! Error types for the Oxyde SDK
2//!
3//! This module provides the error types used throughout the SDK.
4
5use std::io;
6
7use thiserror::Error;
8
9/// Main error type for the Oxyde SDK
10#[derive(Error, Debug)]
11pub enum OxydeError {
12    /// Configuration errors
13    #[error("Configuration error: {0}")]
14    ConfigurationError(String),
15
16    /// Memory system errors
17    #[error("Memory error: {0}")]
18    MemoryError(String),
19
20    /// Inference engine errors
21    #[error("Inference error: {0}")]
22    InferenceError(String),
23
24    /// Intent understanding errors
25    #[error("Intent error: {0}")]
26    IntentError(String),
27
28    /// Behavior execution errors
29    #[error("Behavior error: {0}")]
30    BehaviorError(String),
31
32    /// Engine binding errors
33    #[error("Binding error: {0}")]
34    BindingError(String),
35
36    /// IO errors
37    #[error("IO error: {0}")]
38    IoError(#[from] io::Error),
39
40    /// Serialization errors
41    #[error("Serialization error: {0}")]
42    SerializationError(#[from] serde_json::Error),
43
44    /// Request errors
45    #[error("Request error: {0}")]
46    RequestError(String),
47    
48    /// CLI errors
49    #[error("CLI error: {0}")]
50    CliError(String),
51}
52
53// Display implementation is automatically provided by thiserror derive macro
54// No need for manual implementation