platform/error/
database_error.rs1use thiserror::Error;
6
7#[derive(Error, Debug)]
9pub enum DatabaseError {
10 #[error("Connection failed: {message}")]
11 ConnectionFailed { message: String },
12
13 #[error("Query failed: {query}")]
14 QueryFailed { query: String },
15
16 #[error("Transaction failed: {message}")]
17 TransactionFailed { message: String },
18
19 #[error("Migration failed: {version}")]
20 MigrationFailed { version: String },
21
22 #[error("Database not found: {name}")]
23 NotFound { name: String },
24
25 #[error("Constraint violation: {constraint}")]
26 ConstraintViolation { constraint: String },
27
28 #[error("SQLite error: {0}")]
29 Sqlite(#[from] sqlx::Error),
30}