#[derive(Debug, thiserror::Error, Clone)]
pub enum Error {
#[error("Connection Error: {0}")]
ConnectionError(String),
#[error("Schema Error: {0}")]
SchemaError(String),
#[cfg(feature = "migrations")]
#[error("{0}")]
MigrationError(#[from] MigrationError),
#[error("QueryBuilderError: {0} ({1})")]
QueryBuilderError(String, String),
#[error("ColumnNotFound: Table({0}) {1}")]
ColumnNotFound(String, String),
#[error("Column Skipped")]
ColumnSkipped,
#[error("No Rows Found - Query: '{query}'")]
NoRowsFound {
query: String,
},
#[cfg(feature = "pagination")]
#[error("Pagination Error: {0}")]
PaginationError(String),
#[error("Not Implemented")]
NotImplemented,
#[error("Error Hashing Password: {0}")]
HashingError(String),
#[error("Serde Error: {0}")]
SerdeError(String),
#[error("Unknown Variant {0}")]
UnknownVariant(String),
#[error("Unknown Error / Generic Error occurred")]
Unknown,
#[cfg(feature = "two-factor-auth")]
#[error("TOTP Error: {0}")]
TotpError(String),
#[error("SystemTime Error: {0}")]
SystemTimeError(#[from] std::time::SystemTimeError),
#[cfg(feature = "libsql")]
#[error(
"LibSQL Error: {error}\n -> {query}\nPlease report this error to the GeekORM developers"
)]
LibSQLError {
error: String,
query: String,
},
#[cfg(feature = "rusqlite")]
#[error("RuSQLite Error occurred: {0}")]
RuSQLiteError(String),
#[error(
"Query Syntax Error: {error}\n -> {query}\nPlease report this error to the GeekORM developers"
)]
QuerySyntaxError {
error: String,
query: String,
},
}
#[cfg(feature = "migrations")]
#[derive(Debug, thiserror::Error, Clone)]
pub enum MigrationError {
#[error("Missing Table `{0}`")]
MissingTable(String),
#[error("Missing Column `{table}.{column}`")]
MissingColumn {
table: String,
column: String,
},
#[error("Column Type Mismatch `{table}.{column}`: {feature}")]
ColumnTypeMismatch {
table: String,
column: String,
feature: String,
},
#[error("New Table `{table}`")]
NewTable {
table: String,
},
#[error("New Column `{table}.{column}`")]
NewColumn {
table: String,
column: String,
},
#[error("Upgrade Error: {0}")]
UpgradeError(String),
#[error("Missing Migration: {0}")]
MissingMigration(String),
}