Skip to main content

gonzalo_core/
error.rs

1//! Core error type. Note: write *conflicts* are NOT errors — they are a
2//! typed `PutResult` variant (see `store.rs`). Errors here are genuine
3//! failures (I/O, serialization, missing parent for an update).
4
5use crate::RecordKey;
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum CoreError {
10    #[error("record not found: {0}")]
11    NotFound(RecordKey),
12    #[error("serialization error: {0}")]
13    Serde(String),
14    #[error("backend error: {0}")]
15    Backend(String),
16}
17
18pub type Result<T> = std::result::Result<T, CoreError>;