You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
662 B
Rust
25 lines
662 B
Rust
4 years ago
|
use thiserror::Error;
|
||
|
|
||
|
pub type DatabaseResult<T> = Result<T, DatabaseError>;
|
||
|
|
||
|
#[derive(Error, Debug)]
|
||
|
pub enum DatabaseError {
|
||
|
#[error("DotEnv Error: {0}")]
|
||
|
DotEnv(#[from] dotenv::Error),
|
||
|
|
||
|
#[error("Connection Error: {0}")]
|
||
|
ConnectionError(#[from] diesel::prelude::ConnectionError),
|
||
|
|
||
|
#[error("Pool Connection Error: {0}")]
|
||
|
PoolConnectionError(#[from] r2d2::Error),
|
||
|
|
||
|
#[error("Migration Error: {0}")]
|
||
|
MigrationError(#[from] diesel_migrations::RunMigrationsError),
|
||
|
|
||
|
#[error("Result Error: {0}")]
|
||
|
ResultError(#[from] diesel::result::Error),
|
||
4 years ago
|
|
||
|
#[error("AsyncError: {0}")]
|
||
|
AsyncError(#[from] tokio_diesel::AsyncError),
|
||
4 years ago
|
}
|