Added source and destination accounts.
This commit is contained in:
+4
-1
@@ -3,7 +3,7 @@ use axum::{
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
|
||||
use crate::{domain::DomainError, repository::RepositoryError};
|
||||
use crate::{database::DatabaseError, domain::DomainError, repository::RepositoryError};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum AppError {
|
||||
@@ -32,6 +32,9 @@ impl IntoResponse for AppError {
|
||||
Self::Domain(error) => {
|
||||
return error_response(StatusCode::UNPROCESSABLE_ENTITY, error.to_string());
|
||||
}
|
||||
Self::Repository(RepositoryError::Database(DatabaseError::ForeignKeyViolation)) => {
|
||||
return error_response(StatusCode::UNPROCESSABLE_ENTITY, "Reference violation");
|
||||
}
|
||||
Self::Repository(RepositoryError::Database(error)) => {
|
||||
tracing::error!(%error, "Database query failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user