remove OIDC/Postgres, replace ApiError w/ AppError, move params to api-types
This commit is contained in:
@@ -29,6 +29,12 @@ pub enum DomainError {
|
||||
#[error("Forbidden: {0}")]
|
||||
Forbidden(String),
|
||||
|
||||
#[error("Not found: {0}")]
|
||||
NotFound(String),
|
||||
|
||||
#[error("Conflict: {0}")]
|
||||
Conflict(String),
|
||||
|
||||
#[error("Repository error: {0}")]
|
||||
RepositoryError(String),
|
||||
|
||||
@@ -52,12 +58,12 @@ impl DomainError {
|
||||
pub fn is_not_found(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
DomainError::UserNotFound(_) | DomainError::ChannelNotFound(_)
|
||||
DomainError::UserNotFound(_) | DomainError::ChannelNotFound(_) | DomainError::NotFound(_)
|
||||
)
|
||||
}
|
||||
|
||||
pub fn is_conflict(&self) -> bool {
|
||||
matches!(self, DomainError::UserAlreadyExists(_))
|
||||
matches!(self, DomainError::UserAlreadyExists(_) | DomainError::Conflict(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user