Skip to main content

cea_core/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum CeaCoreError {
3    #[error("invalid input: {0}")]
4    InvalidInput(String),
5
6    #[error("invalid configuration: {0}")]
7    InvalidConfig(String),
8
9    #[error("graph corruption: {0}")]
10    GraphCorruption(String),
11
12    #[error("unsupported graph schema version: expected {expected}, found {found}")]
13    UnsupportedSchemaVersion { expected: u32, found: u32 },
14
15    #[error("io error: {0}")]
16    Io(#[from] std::io::Error),
17
18    /// Persistence-layer error. Wraps `postcard::Error` (which is a
19    /// single enum type covering both serialize and deserialize
20    /// failures — much cleaner than bincode 2's split EncodeError /
21    /// DecodeError design). The bincode 1.3.3 source this replaced
22    /// had a similar `#[from] bincode::Error` design; the API is
23    /// effectively identical at the call site.
24    #[error("persistence error: {0}")]
25    Persistence(#[from] postcard::Error),
26}