mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +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() {
|
if error.current_context().is_db_unique_violation() {
|
||||||
db.find_customer_by_customer_id_merchant_id(customer_id, merchant_id)
|
db.find_customer_by_customer_id_merchant_id(customer_id, merchant_id)
|
||||||
.await
|
.await
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
.map_err(|err| {
|
||||||
.attach_printable_lazy(|| {
|
err.to_not_found_response(errors::ApiErrorResponse::InternalServerError)
|
||||||
format!("Failed while fetching Customer, customer_id: {customer_id}")
|
.attach_printable(format!(
|
||||||
|
"Failed while fetching Customer, customer_id: {customer_id}",
|
||||||
|
))
|
||||||
})?
|
})?
|
||||||
} else {
|
} else {
|
||||||
Err(error
|
Err(error
|
||||||
|
|||||||
Reference in New Issue
Block a user