feat: add shared RepoError module
This commit is contained in:
13
apps/nxmesh-master/src/service/error.rs
Normal file
13
apps/nxmesh-master/src/service/error.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
|
||||||
|
pub enum RepoError {
|
||||||
|
#[error("internal error: {0}")]
|
||||||
|
InternalError(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<sea_orm::DbErr> for RepoError {
|
||||||
|
fn from(err: sea_orm::DbErr) -> Self {
|
||||||
|
match err {
|
||||||
|
other => RepoError::InternalError(other.to_string()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user