mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-05-31 14:09:10 -07:00
Ansible async errors + printing formatter issues (#170)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
4b1523e833
commit
2ebb8245b5
6 changed files with 14 additions and 13 deletions
|
@ -422,8 +422,8 @@ def return_if_object(module, response, kind, allow_not_found=False):
|
|||
try:
|
||||
module.raise_for_status(response)
|
||||
result = response.json()
|
||||
except getattr(json.decoder, 'JSONDecodeError', ValueError) as inst:
|
||||
module.fail_json(msg="Invalid JSON response with error: %s" % inst)
|
||||
except getattr(json.decoder, 'JSONDecodeError', ValueError):
|
||||
module.fail_json(msg="Invalid JSON response with error: %s" % response.text)
|
||||
|
||||
if navigate_hash(result, ['error', 'errors']):
|
||||
module.fail_json(msg=navigate_hash(result, ['error', 'errors']))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue