From ab8c7af1b8b34366122883f4fced38c3bd4cd629 Mon Sep 17 00:00:00 2001 From: Timothy Rae Date: Tue, 13 Dec 2022 17:05:26 +1300 Subject: [PATCH] Fix broken print statement --- sync.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sync.py b/sync.py index 48a7f35..00ce861 100755 --- a/sync.py +++ b/sync.py @@ -109,10 +109,11 @@ def repeat_on_http_error(function, *args, remaining=5, **kwargs): try: return function(*args, **kwargs) except requests.exceptions.HTTPError as e: + resp = e.response if remaining: - print(f"HTTPError {e.json()} occurred. Retrying {remaining} more times.") + print(f"HTTPError {resp.status_code} occurred. Retrying {remaining} more times.\n\n{resp.text}") else: - print(f"Repeated HTTPError {e.json()} occurred and could not be recovered\n\n The following arguments were provided:") + print(f"Repeated HTTPError {resp.status_code} occurred and could not be recovered\n\n{resp.text}\n\nThe following arguments were provided:") print(args) print(traceback.format_exc()) sys.exit(1)