From b848841337670f43f7c317a11cb8ed4ca2dcaede Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 01:35:28 +0200 Subject: [PATCH] Add logger error messages for Stripe errors --- utils/stripe_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 98f85d62..8fcf0ab1 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -28,28 +28,34 @@ def handleStripeError(f): body = e.json_body err = body['error'] response.update({'error': err['message']}) + logger.error(str(e)) return response except stripe.error.RateLimitError as e: response.update( {'error': "Too many requests made to the API too quickly"}) return response except stripe.error.InvalidRequestError as e: + logger.error(str(e)) response.update({'error': "Invalid parameters"}) return response except stripe.error.AuthenticationError as e: # Authentication with Stripe's API failed # (maybe you changed API keys recently) + logger.error(str(e)) response.update({'error': common_message}) return response except stripe.error.APIConnectionError as e: + logger.error(str(e)) response.update({'error': common_message}) return response except stripe.error.StripeError as e: # maybe send email + logger.error(str(e)) response.update({'error': common_message}) return response except Exception as e: # maybe send email + logger.error(str(e)) response.update({'error': common_message}) return response