diff options
author | Ben Copeland <ben.copeland@linaro.org> | 2017-12-29 10:32:05 +0000 |
---|---|---|
committer | Ben Copeland <ben.copeland@linaro.org> | 2017-12-29 10:32:25 +0000 |
commit | 20619788f9a38f3b7a47e0ff2c6124b79a739d75 (patch) | |
tree | c3812f73242397e4aeb369333205d3785699d171 | |
parent | 9f520b1b112412a7f018502b202ee50ab607320b (diff) |
Debugging: Print out the request headers and body when the exception is
hit.
Change-Id: Ia276fb880d5a317312fe333003ea608661cb8912
-rwxr-xr-x | linaro-cp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linaro-cp.py b/linaro-cp.py index e520804..0b18179 100755 --- a/linaro-cp.py +++ b/linaro-cp.py @@ -32,7 +32,7 @@ class API_v1(object): else: print("Unsuccessful status:", resp.status_code) except Exception as e: - print(e) + print('Error: %s,\nBody: %s,\nHeaders: %s' % (e, resp.content, resp.headers)) print('Upload failed for %s, retry attempt %s' % (url, x)) time.sleep(2 * x + 1) retry_count -= 1 @@ -148,7 +148,7 @@ class API_v3(API_v1): else: print("Unsuccessful status:", resp.status_code) except Exception as e: - print(e) + print('Error: %s,\nBody: %s,\nHeaders: %s' % (e, resp.content, resp.headers)) print('Upload failed for %s, retry attempt %s' % (url, x)) time.sleep(2 * x + 1) retry_count -= 1 |