Skip to main content

saf_core/
error.rs

1//! Core error types for `saf-core` operations.
2
3use thiserror::Error;
4
5/// Errors from `saf-core` operations.
6#[derive(Debug, Error)]
7pub enum CoreError {
8    /// Schema version mismatch during deserialization.
9    #[error("schema version mismatch: expected {expected}, found {found}")]
10    SchemaMismatch {
11        /// The expected schema version.
12        expected: String,
13        /// The schema version that was found.
14        found: String,
15    },
16
17    /// Invalid ID format.
18    #[error("invalid entity ID: {0}")]
19    InvalidId(String),
20
21    /// Spec registry error.
22    #[error("spec error: {0}")]
23    Spec(String),
24
25    /// I/O error.
26    #[error("I/O error: {0}")]
27    Io(#[from] std::io::Error),
28}