55 lines
1.2 KiB
Rust
55 lines
1.2 KiB
Rust
use axum::http::Uri;
|
|
|
|
use crate::{domain::DomainError, repository::RepositoryError, routes::extractors::ExtractorError};
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum AppError {
|
|
#[error("account not found")]
|
|
AccountNotFound,
|
|
|
|
#[error("user not found")]
|
|
UserNotFound,
|
|
|
|
#[error("account id already exists")]
|
|
AccountIdAlreadyExists,
|
|
|
|
#[error("app id already exists")]
|
|
AppIdAlreadyExists,
|
|
|
|
#[error("scheduled transaction id already exists")]
|
|
ScheduledTransactionIdAlreadyExists,
|
|
|
|
#[error("transaction id already exists")]
|
|
TransactionIdAlreadyExists,
|
|
|
|
#[error("invalid client credentials")]
|
|
InvalidClientCredentials,
|
|
|
|
#[error("invalid refresh token")]
|
|
InvalidRefreshToken,
|
|
|
|
#[error("not found")]
|
|
NotFound,
|
|
|
|
#[error("not found: {0}")]
|
|
NotFoundWithUri(Uri),
|
|
|
|
#[error("race condition occurred")]
|
|
RaceCondition,
|
|
|
|
#[error("unknown")]
|
|
Unknown,
|
|
|
|
#[error(transparent)]
|
|
Domain(#[from] DomainError),
|
|
|
|
#[error(transparent)]
|
|
Extractor(#[from] ExtractorError),
|
|
|
|
#[error(transparent)]
|
|
Repository(#[from] RepositoryError),
|
|
|
|
#[error(transparent)]
|
|
Internal(#[from] anyhow::Error),
|
|
}
|