Skip to main content

cyanea_core/
error.rs

1//! Structured error types for the Cyanea ecosystem.
2
3use thiserror::Error;
4
5/// Unified error type for all Cyanea operations.
6#[derive(Debug, Error)]
7pub enum CyaneaError {
8    /// I/O error (file not found, permission denied, etc.)
9    #[error("I/O error: {0}")]
10    Io(#[from] std::io::Error),
11
12    /// Parse error (malformed input data)
13    #[error("parse error: {0}")]
14    Parse(String),
15
16    /// Invalid input (bad arguments, out-of-range values)
17    #[error("invalid input: {0}")]
18    InvalidInput(String),
19
20    /// Compression or decompression failure
21    #[error("compression error: {0}")]
22    Compression(String),
23
24    /// Hashing failure
25    #[error("hash error: {0}")]
26    Hash(String),
27
28    /// Catch-all for other errors
29    #[error("{0}")]
30    Other(String),
31}
32
33/// Convenience alias used throughout the Cyanea ecosystem.
34pub type Result<T> = std::result::Result<T, CyaneaError>;