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:
parent
1384270ccd
commit
2e0bec293c
1 changed files with 4 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue