mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
Improve error handling for ansible-core-ci. (#17734)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user