1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Improve error handling for ansible-core-ci. (#17734)

This commit is contained in:
Matt Clay 2016-09-23 14:42:47 -07:00 committed by GitHub
parent 1384270ccd
commit 2e0bec293c

View file

@ -359,7 +359,10 @@ class HttpResponse:
self.response = response
def json(self):
return json.loads(self.response)
try:
return json.loads(self.response)
except ValueError:
raise ValueError('Cannot parse response as JSON:\n%s' % self.response)
requests = HttpRequest()