From 753d92897f59736c5a969b89d4f8b7cbbf20af3c Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 16 Sep 2024 21:18:43 +0100 Subject: [PATCH] Try to add extra debug to the API call --- fsutils/download_list.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fsutils/download_list.py b/fsutils/download_list.py index 8004dc3883..b5b0923d0d 100644 --- a/fsutils/download_list.py +++ b/fsutils/download_list.py @@ -376,18 +376,30 @@ def update_fs_version_mgr(build_info, config): url = "https://www.firestormviewer.org/set-fs-vrsns-jsn/" headers = {"Content-Type": "application/json"} + response = None # Initialize response to None + try: response = requests.post(url, json=payload, headers=headers) response.raise_for_status() + + # Parse the response data response_data = response.json() result = response_data.get('result') message = response_data.get('message') + if result == 'success': print(f"Version manager updated successfully for {os_name} {build_variant}") else: print(f"Error updating version manager: {message}") + except requests.exceptions.RequestException as e: print(f"API request failed: {e}") + + # Check if response is available and check for status code 403 + if response and response.status_code == 403: + print("Status Code:", response.status_code) + print("Response Headers:", response.headers) + print("Response Body:", response.text) except ValueError: print("API response is not valid JSON")