Skip to main content

schema_installer/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum SchemaInstallerError {
5    #[error("Database connection error: {0}")]
6    Connection(String),
7
8    #[error("Schema parse error: {0}")]
9    Parse(String),
10
11    #[error("SQL generation error: {0}")]
12    Generation(String),
13
14    #[error("SQL execution error: {0}")]
15    Execution(String),
16
17    #[error("IO error: {0}")]
18    Io(#[from] std::io::Error),
19
20    #[error("Schema file not found: {0}")]
21    SchemaFileNotFound(String),
22
23    #[error("Invalid configuration: {0}")]
24    InvalidConfiguration(String),
25
26    #[error("Database error: {0}")]
27    Database(String),
28
29    #[error("Checksum mismatch for migration {version}: expected {expected}, found {found}")]
30    ChecksumMismatch {
31        version: String,
32        expected: String,
33        found: String,
34    },
35
36    #[error("Migration failed for version {version}: {error}")]
37    MigrationFailed { version: String, error: String },
38}