22 lines
427 B
Rust
22 lines
427 B
Rust
use sea_orm::DbErr;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum DbError {
|
|
#[error("database error: {0}")]
|
|
SeaOrm(#[from] DbErr),
|
|
|
|
#[error("migration error: {0}")]
|
|
Migration(String),
|
|
|
|
#[error("not found: {0}")]
|
|
NotFound(String),
|
|
|
|
#[error("serialization error: {0}")]
|
|
Serialization(#[from] serde_json::Error),
|
|
|
|
#[error("{0}")]
|
|
Other(String),
|
|
}
|
|
|
|
pub type DbResult<T> = Result<T, DbError>;
|