diff --git a/ecommerce/extensions/iap/api/v1/constants.py b/ecommerce/extensions/iap/api/v1/constants.py index 4ba77782b25..7bfcd9ed8e8 100644 --- a/ecommerce/extensions/iap/api/v1/constants.py +++ b/ecommerce/extensions/iap/api/v1/constants.py @@ -6,6 +6,7 @@ ERROR_ALREADY_PURCHASED = "You have already purchased these products" ERROR_BASKET_NOT_FOUND = "Basket [{}] not found." ERROR_BASKET_ID_NOT_PROVIDED = "Basket id is not provided" +ERROR_DURING_IOS_REFUND_EXECUTION = "Could not execute IOS refund." ERROR_DURING_ORDER_CREATION = "An error occurred during order creation." ERROR_DURING_PAYMENT_HANDLING = "An error occurred during payment handling." ERROR_ORDER_NOT_FOUND_FOR_REFUND = "Could not find any order to refund for [%s] by processor [%s]" diff --git a/ecommerce/extensions/iap/api/v1/views.py b/ecommerce/extensions/iap/api/v1/views.py index c80d4605235..d508b410865 100644 --- a/ecommerce/extensions/iap/api/v1/views.py +++ b/ecommerce/extensions/iap/api/v1/views.py @@ -38,6 +38,7 @@ COURSE_ALREADY_PAID_ON_DEVICE, ERROR_ALREADY_PURCHASED, ERROR_BASKET_ID_NOT_PROVIDED, + ERROR_DURING_IOS_REFUND_EXECUTION, ERROR_BASKET_NOT_FOUND, ERROR_DURING_ORDER_CREATION, ERROR_DURING_PAYMENT_HANDLING, @@ -359,8 +360,9 @@ def post(self, request): logger.info(IGNORE_NON_REFUND_NOTIFICATION_FROM_APPLE) return Response(status=status.HTTP_200_OK) - except Exception: # pylint: disable=broad-except - pass + except Exception as e: # pylint: disable=broad-except + logger.error(ERROR_DURING_IOS_REFUND_EXECUTION) + logger.error(e) status_code = status.HTTP_200_OK if is_refunded else status.HTTP_500_INTERNAL_SERVER_ERROR return Response(status=status_code)