From 470369e2987fd8473305e19f1174cdfec232fee7 Mon Sep 17 00:00:00 2001 From: eli fessler Date: Wed, 30 Nov 2022 11:05:08 -1000 Subject: [PATCH] improve error printing (show problematic result ID) --- s3s.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/s3s.py b/s3s.py index 18d8f56..2e9d681 100755 --- a/s3s.py +++ b/s3s.py @@ -1082,7 +1082,11 @@ def post_result(data, ismonitoring, isblackout, istestrun, overview_data=None): print(f"* time uploaded: {time_uploaded}; time now: {time_now}") if postbattle.status_code != 201: # Created (or already exists) - print(f"Error uploading {utils.set_noun(which)[:-1]}. Message from server:") + print(f"Error uploading {utils.set_noun(which)[:-1]}.") + detail_type = "vsHistoryDetail" if which == "ink" else "coopHistoryDetail" + result_id = data["data"][detail_type]["id"] + print(f"{utils.set_noun(which)[:-1].capitalize()} ID: {result_id}") + print("Message from server:") print(postbattle.content.decode('utf-8')) elif time_uploaded <= time_now - 5: # give some leeway print(f"{utils.set_noun(which)[:-1].capitalize()} already uploaded - {headerloc}")