aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-13 15:54:38 +0100
committerGitHub <noreply@github.com>2019-08-13 15:54:38 +0100
commit66c3acbd36c8468a807f664c79e6358c8b5dd31d (patch)
treefc11d5608c2ca7ea7054a39853edf34dd475d14f
parent6597e51e5a56e7285a41041bb4b80b98ef4b8773 (diff)
parent46727d273491d5ce2b7e74cd1b1f4501607db28f (diff)
downloadrspamd-66c3acbd36c8468a807f664c79e6358c8b5dd31d.tar.gz
rspamd-66c3acbd36c8468a807f664c79e6358c8b5dd31d.zip
Merge pull request #3002 from citrin/coveralls
[Minor] Ignore coveralls API errors
-rwxr-xr-xtest/tools/merge_coveralls.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/test/tools/merge_coveralls.py b/test/tools/merge_coveralls.py
index 8fad0f55b..09380a386 100755
--- a/test/tools/merge_coveralls.py
+++ b/test/tools/merge_coveralls.py
@@ -160,12 +160,17 @@ if __name__ == '__main__':
if args.token:
j1['repo_token'] = args.token
- print("sending data to coveralls...")
- r = requests.post('https://coveralls.io/api/v1/jobs', files={"json_file": json.dumps(j1)})
- response = r.json()
- print("[coveralls] %s" % response['message'])
- if 'url' in response:
- print("[coveralls] Uploaded to %s" % response['url'])
-
- # post https://coveralls.io/api/v1/jobs
- # print args
+ try:
+ r = requests.post('https://coveralls.io/api/v1/jobs', files={"json_file": json.dumps(j1)})
+ r.raise_for_status()
+ except requests.exceptions.RequestException as e:
+ print("Failed to send data to coveralls: %s" % e)
+ sys.exit()
+
+ try:
+ response = r.json()
+ print("[coveralls] %s" % response['message'])
+ if 'url' in response:
+ print("[coveralls] Uploaded to %s" % response['url'])
+ except json.decoder.JSONDecodeError:
+ print("Bad resonse: '%s'" % r.text)