use thiserror::Error;
#[derive(Debug, Error)]
pub enum HtapError {
#[error("OLTP error: {0}")]
Oltp(#[from] rhei_oltp_rusqlite::RusqliteOltpError),
#[error("OLTP backend error: {0}")]
OltpBackend(#[from] rhei_olap::OltpError),
#[error("OLAP error: {0}")]
Olap(#[from] rhei_olap::OlapError),
#[error("sync error: {0}")]
Sync(#[from] rhei_sync::SyncError),
#[error("core error: {0}")]
Core(#[from] rhei_core::CoreError),
#[cfg(feature = "sidecar")]
#[error("sidecar error: {0}")]
Sidecar(#[from] rhei_sidecar::SidecarError),
#[cfg(feature = "rocksdb-cdc")]
#[error("RocksDB CDC error: {0}")]
RocksDbCdc(#[from] rhei_cdc_rocksdb::RocksDbCdcError),
#[error("engine not initialized")]
NotInitialized,
#[error("OLTP engine not available in sidecar mode")]
OltpNotAvailable,
#[error("{0}")]
Other(String),
}