Skip to main content

nova_boot_graphdb/
error.rs

1use std::fmt;
2
3/// Error type emitted by graph store adapters.
4#[derive(Debug)]
5pub enum GraphDbError {
6    /// Backend-specific error with details.
7    Backend(String),
8    /// Placeholder for unfinished features.
9    NotImplemented(&'static str),
10    /// Validation or input parsing error.
11    InvalidInput(String),
12    /// Serialization/deserialization error.
13    Serialization(String),
14}
15
16impl fmt::Display for GraphDbError {
17    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18        match self {
19            Self::Backend(msg) => write!(f, "backend error: {msg}"),
20            Self::NotImplemented(msg) => write!(f, "not implemented: {msg}"),
21            Self::InvalidInput(msg) => write!(f, "invalid input: {msg}"),
22            Self::Serialization(msg) => write!(f, "serialization error: {msg}"),
23        }
24    }
25}
26
27impl std::error::Error for GraphDbError {}