rhei 1.5.1

Lightweight serverless HTAP engine — Rusqlite (OLTP) + DuckDB/DataFusion (OLAP) with CDC replication
Documentation
//! Error types for the top-level HTAP engine facade.
//!
//! [`HtapError`] is the single error type returned by all [`crate::HtapEngine`]
//! methods. Variants are produced by the underlying crates and converted via
//! `From` implementations generated by `thiserror`.

use thiserror::Error;

/// Unified error type for all [`crate::HtapEngine`] operations.
///
/// Each variant corresponds to a subsystem. The `#[from]` derive means callers
/// can use `?` on any underlying crate error and it will be promoted
/// automatically to the correct `HtapError` variant.
#[derive(Debug, Error)]
pub enum HtapError {
    /// An error from the Rusqlite OLTP engine.
    #[error("OLTP error: {0}")]
    Oltp(#[from] rhei_oltp_rusqlite::RusqliteOltpError),

    /// An error from the OLTP backend dispatcher (e.g. routing to an
    /// unavailable OLTP engine variant).
    #[error("OLTP backend error: {0}")]
    OltpBackend(#[from] rhei_olap::OltpError),

    /// An error from the OLAP engine (DuckDB or DataFusion).
    #[error("OLAP error: {0}")]
    Olap(#[from] rhei_olap::OlapError),

    /// An error from the CDC sync engine.
    #[error("sync error: {0}")]
    Sync(#[from] rhei_sync::SyncError),

    /// An error from the `rhei-core` shared types layer (e.g. schema
    /// validation, identifier checking).
    #[error("core error: {0}")]
    Core(#[from] rhei_core::CoreError),

    /// An error from the sidecar CDC consumer.
    ///
    /// Available on crate feature `sidecar` only.
    #[cfg(feature = "sidecar")]
    #[error("sidecar error: {0}")]
    Sidecar(#[from] rhei_sidecar::SidecarError),

    /// An error from the RocksDB CDC log.
    ///
    /// Available on crate feature `rocksdb-cdc` only.
    #[cfg(feature = "rocksdb-cdc")]
    #[error("RocksDB CDC error: {0}")]
    RocksDbCdc(#[from] rhei_cdc_rocksdb::RocksDbCdcError),

    /// The engine was used before it finished initializing.
    #[error("engine not initialized")]
    NotInitialized,

    /// A write or OLTP-only read was attempted while running in pure sidecar
    /// mode (no local OLTP engine). Check [`crate::SidecarConfig::enable_local_oltp`].
    #[error("OLTP engine not available in sidecar mode")]
    OltpNotAvailable,

    /// A catch-all for miscellaneous errors with a descriptive message.
    #[error("{0}")]
    Other(String),
}