From a072d6c0cdc86f229dc1f814cf087a5a66469649 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sat, 14 Nov 2020 12:55:53 +0100 Subject: [PATCH] only report the paddle error if it's not 147 --- app/paddle_utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/paddle_utils.py b/app/paddle_utils.py index 20d04042..c0c3af59 100644 --- a/app/paddle_utils.py +++ b/app/paddle_utils.py @@ -91,15 +91,14 @@ def change_plan(subscription_id: str, plan_id) -> (bool, str): ) res = r.json() if not res["success"]: - LOG.exception( - f"cannot change subscription {subscription_id} to {plan_id}, paddle response: {res}" - ) try: # "unable to complete the resubscription because we could not charge the customer for the resubscription" if res["error"]["code"] == 147: return False, "Your card cannot be charged" except: - LOG.warning("Cannot parse error code from %s", res) + LOG.exception( + f"cannot change subscription {subscription_id} to {plan_id}, paddle response: {res}" + ) return False, "" return False, ""