drizzle_cli/
error.rs

1//! Error types for the CLI
2
3use thiserror::Error;
4
5use crate::config::ConfigError;
6
7/// CLI errors
8#[derive(Debug, Error)]
9pub enum CliError {
10    /// Configuration error
11    #[error("Configuration error: {0}")]
12    Config(#[from] ConfigError),
13
14    /// I/O error
15    #[error("I/O error: {0}")]
16    IoError(String),
17
18    /// No schema files found
19    #[error("No schema files found matching: {0}")]
20    NoSchemaFiles(String),
21
22    /// Dialect mismatch between snapshots
23    #[error("Dialect mismatch between previous and current snapshots")]
24    DialectMismatch,
25
26    /// Database connection error
27    #[error("Database connection failed: {0}")]
28    ConnectionError(String),
29
30    /// Migration execution error
31    #[error("Migration failed: {0}")]
32    MigrationError(String),
33
34    /// Missing database driver
35    #[error("No driver available for {dialect}. Build with '{feature}' feature enabled.")]
36    MissingDriver {
37        dialect: &'static str,
38        feature: &'static str,
39    },
40
41    /// Other errors
42    #[error("{0}")]
43    Other(String),
44}