Added additional transaction operations.
This commit is contained in:
+10
-1
@@ -9,7 +9,10 @@ use crate::routes::{
|
||||
scheduled_transaction::RecurringTransactionConversionError,
|
||||
transaction::TransactionConversionError,
|
||||
},
|
||||
validation::scheduled_transaction::ScheduledTransactionValidationError,
|
||||
validation::{
|
||||
scheduled_transaction::ScheduledTransactionValidationError,
|
||||
transaction::TransactionValidationError,
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@@ -31,6 +34,9 @@ pub enum AppError {
|
||||
|
||||
#[error("scheduled transaction validation error")]
|
||||
ScheduledTransactionValidation(#[from] ScheduledTransactionValidationError),
|
||||
|
||||
#[error("transaction validation error")]
|
||||
TransactionValidation(#[from] TransactionValidationError),
|
||||
}
|
||||
|
||||
impl IntoResponse for AppError {
|
||||
@@ -42,6 +48,9 @@ impl IntoResponse for AppError {
|
||||
Self::ScheduledTransactionValidation(error) => {
|
||||
return (StatusCode::UNPROCESSABLE_ENTITY, error.to_string()).into_response();
|
||||
}
|
||||
Self::TransactionValidation(error) => {
|
||||
return (StatusCode::UNPROCESSABLE_ENTITY, error.to_string()).into_response();
|
||||
}
|
||||
Self::Database(error) => {
|
||||
tracing::error!(%error, "Database query failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user