ic_dbms_api/
error.rs

1use candid::CandidType;
2use serde::{Deserialize, Serialize};
3use thiserror::Error;
4
5/// IcDbms Error type
6#[derive(Debug, Error, CandidType, Serialize, Deserialize)]
7pub enum IcDbmsError {
8    #[error("Memory error: {0}")]
9    Memory(#[from] crate::memory::MemoryError),
10    #[error("Query error: {0}")]
11    Query(#[from] crate::dbms::query::QueryError),
12    #[error("Table error: {0}")]
13    Table(#[from] crate::dbms::table::TableError),
14    #[error("Transaction error: {0}")]
15    Transaction(#[from] crate::dbms::transaction::TransactionError),
16    #[error("Validation error: {0}")]
17    Validation(String),
18}
19
20/// IcDbms Result type
21pub type IcDbmsResult<T> = Result<T, IcDbmsError>;