1#[derive(Debug, thiserror::Error, Clone)]
5pub enum Error {
6 #[error("Connection Error: {0}")]
8 ConnectionError(String),
9 #[error("Schema Error: {0}")]
11 SchemaError(String),
12 #[cfg(feature = "migrations")]
14 #[error("{0}")]
15 MigrationError(#[from] MigrationError),
16
17 #[error("QueryBuilderError: {0} ({1})")]
19 QueryBuilderError(String, String),
20
21 #[error("ColumnNotFound: Table({0}) {1}")]
23 ColumnNotFound(String, String),
24
25 #[error("Column Skipped")]
27 ColumnSkipped,
28
29 #[error("No Rows Found - Query: '{query}'")]
31 NoRowsFound {
32 query: String,
34 },
35
36 #[cfg(feature = "pagination")]
38 #[error("Pagination Error: {0}")]
39 PaginationError(String),
40
41 #[error("Not Implemented")]
43 NotImplemented,
44
45 #[error("Error Hashing Password: {0}")]
47 HashingError(String),
48
49 #[error("Serde Error: {0}")]
51 SerdeError(String),
52
53 #[error("Unknown Variant {0}")]
55 UnknownVariant(String),
56
57 #[error("Unknown Error / Generic Error occurred")]
59 Unknown,
60
61 #[cfg(feature = "two-factor-auth")]
63 #[error("TOTP Error: {0}")]
64 TotpError(String),
65 #[error("SystemTime Error: {0}")]
67 SystemTimeError(#[from] std::time::SystemTimeError),
68
69 #[cfg(feature = "libsql")]
71 #[error(
72 "LibSQL Error: {error}\n -> {query}\nPlease report this error to the GeekORM developers"
73 )]
74 LibSQLError {
75 error: String,
77 query: String,
79 },
80
81 #[cfg(feature = "rusqlite")]
83 #[error("RuSQLite Error occurred: {0}")]
84 RuSQLiteError(String),
85
86 #[error(
88 "Query Syntax Error: {error}\n -> {query}\nPlease report this error to the GeekORM developers"
89 )]
90 QuerySyntaxError {
91 error: String,
93 query: String,
95 },
96}
97
98#[cfg(feature = "migrations")]
100#[derive(Debug, thiserror::Error, Clone)]
101pub enum MigrationError {
102 #[error("Missing Table `{0}`")]
104 MissingTable(String),
105 #[error("Missing Column `{table}.{column}`")]
107 MissingColumn {
108 table: String,
110 column: String,
112 },
113 #[error("Column Type Mismatch `{table}.{column}`: {feature}")]
115 ColumnTypeMismatch {
116 table: String,
118 column: String,
120 feature: String,
122 },
123
124 #[error("New Table `{table}`")]
126 NewTable {
127 table: String,
129 },
130 #[error("New Column `{table}.{column}`")]
132 NewColumn {
133 table: String,
135 column: String,
137 },
138
139 #[error("Upgrade Error: {0}")]
141 UpgradeError(String),
142 #[error("Missing Migration: {0}")]
144 MissingMigration(String),
145}