1use thiserror::Error;
4
5use crate::config::Error;
6
7#[derive(Debug, Error)]
9pub enum CliError {
10 #[error("Configuration error: {0}")]
12 Config(#[from] Error),
13
14 #[error("I/O error: {0}")]
16 IoError(String),
17
18 #[error("No schema files found matching: {0}")]
20 NoSchemaFiles(String),
21
22 #[error("Schema parse failed:\n {0}")]
24 SchemaParse(String),
25
26 #[error("Dialect mismatch between previous and current snapshots")]
28 DialectMismatch,
29
30 #[error("Database connection failed: {0}")]
32 ConnectionError(String),
33
34 #[error("Migration failed: {0}")]
36 MigrationError(String),
37
38 #[error(
40 "No database credentials configured: `{0}` needs a database connection \
41 (add a [dbCredentials] section to drizzle.config.toml)"
42 )]
43 MissingCredentials(&'static str),
44
45 #[error("{0}")]
47 Aborted(String),
48
49 #[error("No driver available for {dialect}. Build with '{feature}' feature enabled.")]
51 MissingDriver {
52 dialect: &'static str,
53 feature: &'static str,
54 },
55
56 #[error("{operation} is not supported for driver '{driver}'. {hint}")]
62 UnsupportedForDriver {
63 operation: &'static str,
64 driver: &'static str,
65 hint: &'static str,
66 },
67
68 #[error("{0}")]
70 Other(String),
71}