mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor(payments): attempt to address unintended 5xx and 4xx in payments (#1376)
This commit is contained in:
committed by
GitHub
parent
71c0d4c500
commit
cf64862dac
@ -12,7 +12,7 @@ use crate::{
|
||||
configs::settings,
|
||||
core::{
|
||||
api_keys,
|
||||
errors::{self, RouterResult},
|
||||
errors::{self, utils::StorageErrorExt, RouterResult},
|
||||
},
|
||||
db::StorageInterface,
|
||||
routes::app::AppStateInfo,
|
||||
@ -122,13 +122,7 @@ where
|
||||
.store()
|
||||
.find_merchant_account_by_merchant_id(&stored_api_key.merchant_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
if e.current_context().is_db_not_found() {
|
||||
e.change_context(errors::ApiErrorResponse::Unauthorized)
|
||||
} else {
|
||||
e.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
}
|
||||
})
|
||||
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user