1use candid::CandidType;
2use serde::{Deserialize, Serialize};
3use thiserror::Error;
4
5#[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("Sanitize error: {0}")]
13 Sanitize(String),
14 #[error("Table error: {0}")]
15 Table(#[from] crate::dbms::table::TableError),
16 #[error("Transaction error: {0}")]
17 Transaction(#[from] crate::dbms::transaction::TransactionError),
18 #[error("Validation error: {0}")]
19 Validation(String),
20}
21
22pub type IcDbmsResult<T> = Result<T, IcDbmsError>;