mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-23 03:11:22 -07:00
Fixing method name (#172)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
e6ae9ac421
commit
59d4f930ec
1 changed files with 2 additions and 2 deletions
|
@ -185,8 +185,8 @@ def return_if_object(module, response, 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