ankurah_storage_sqlite/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum SqliteError {
7 #[error("SQLite error: {0}")]
8 Rusqlite(#[from] rusqlite::Error),
9
10 #[error("Connection pool error: {0}")]
11 Pool(String),
12
13 #[error("Serialization error: {0}")]
14 Serialization(#[from] bincode::Error),
15
16 #[error("JSON error: {0}")]
17 Json(#[from] serde_json::Error),
18
19 #[error("DDL error: {0}")]
20 DDL(String),
21
22 #[error("SQL generation error: {0}")]
23 SqlGeneration(String),
24
25 #[error("Task join error: {0}")]
26 TaskJoin(String),
27
28 #[error("Dump error: {0}")]
29 Dump(String),
30}
31
32impl From<SqliteError> for ankurah_core::error::RetrievalError {
33 fn from(err: SqliteError) -> Self { ankurah_core::error::RetrievalError::StorageError(Box::new(err)) }
34}
35
36impl From<SqliteError> for ankurah_core::error::MutationError {
37 fn from(err: SqliteError) -> Self { ankurah_core::error::MutationError::General(Box::new(err)) }
38}
39
40impl From<SqliteError> for ankurah_core::error::StateError {
41 fn from(err: SqliteError) -> Self { ankurah_core::error::StateError::DDLError(Box::new(err)) }
42}