From b71931d812b207ef02a3be0270066c2b04276ae4 Mon Sep 17 00:00:00 2001 From: James Wood Date: Thu, 12 Dec 2024 11:55:47 -0800 Subject: [PATCH] Update to throw exception and fail if request fails --- deployment/harmony_deploy.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/deployment/harmony_deploy.py b/deployment/harmony_deploy.py index 57e46f97..312ad831 100644 --- a/deployment/harmony_deploy.py +++ b/deployment/harmony_deploy.py @@ -59,9 +59,6 @@ def bearer_token() -> str: } response = requests.put(url, headers=headers, json=data) + response.raise_for_status() - print(response.status_code) - try: - print(response.json()) - except json.JSONDecodeError: - print("Response content is not in JSON format") + print(f"Response JSON: {response.json()}")