axion_db/
error.rs

1// axion-db/src/error.rs
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum DbError {
6    #[error("Configuration error: {0}")]
7    Config(String),
8
9    #[error("SQLx connection error: {0}")]
10    Connection(#[from] sqlx::Error),
11
12    #[error("Introspection error: {0}")]
13    Introspection(String),
14
15    #[error("Query execution error: {0}")]
16    QueryExecution(sqlx::Error), // Keep original sqlx::Error for details
17
18    #[error("Unsupported database type for this operation: {0}")]
19    UnsupportedDbType(String),
20
21    #[error("Type mapping error: {0}")]
22    TypeMapping(String),
23
24    #[error("Feature not enabled for database: {0}")]
25    FeatureNotEnabled(String),
26}
27
28pub type DbResult<T> = Result<T, DbError>;