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.
22 lines
410 B
Rust
22 lines
410 B
Rust
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("{0}")]
|
|
SeaOrm(#[from] sea_orm::error::DbErr),
|
|
|
|
#[error("{0}")]
|
|
Msg(String),
|
|
}
|
|
|
|
impl From<&str> for DatabaseError {
|
|
fn from(s: &str) -> Self {
|
|
Self::Msg(s.to_string())
|
|
}
|
|
}
|