Skip to main content

context_forge/
error.rs

1//! Crate-wide error type.
2
3use thiserror::Error;
4
5/// All errors that can originate from this crate.
6#[derive(Debug, Error)]
7#[non_exhaustive]
8pub enum Error {
9    /// An error from the underlying Turso database.
10    #[error("storage error: {0}")]
11    Turso(#[from] turso::Error),
12
13    /// An entry failed validation.
14    #[error("invalid entry: {0}")]
15    InvalidEntry(String),
16
17    /// A schema migration failed.
18    #[error("migration error: {0}")]
19    Migration(String),
20
21    /// A distillation operation failed.
22    #[error("distillation error: {0}")]
23    Distill(String),
24}