mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
fix: fix bug when creating customer who is redacted (#466)
This commit is contained in:
@ -75,9 +75,11 @@ pub async fn create_customer(
|
||||
if error.current_context().is_db_unique_violation() {
|
||||
db.find_customer_by_customer_id_merchant_id(customer_id, merchant_id)
|
||||
.await
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable_lazy(|| {
|
||||
format!("Failed while fetching Customer, customer_id: {customer_id}")
|
||||
.map_err(|err| {
|
||||
err.to_not_found_response(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable(format!(
|
||||
"Failed while fetching Customer, customer_id: {customer_id}",
|
||||
))
|
||||
})?
|
||||
} else {
|
||||
Err(error
|
||||
|
||||
Reference in New Issue
Block a user