mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-09 04:00:31 -07:00
Be more verbose on unexpected failure. (#511)
I spent some time debugging an error, where the unexpected HTTP return code was reported to be -1. Digging deeper, I found the cause using this patch: "An unknown error occurred: ~/.netrc access too permissive: access permissions must restrict access to only the owner"
This commit is contained in:
parent
689a25edcf
commit
6c59811bf9
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- cloudflare_dns - Report unexpected failure with more detail (https://github.com/ansible-collections/community.general/pull/511).
|
|
@ -452,7 +452,7 @@ class CloudflareAPI(object):
|
||||||
timeout=self.timeout)
|
timeout=self.timeout)
|
||||||
|
|
||||||
if info['status'] not in [200, 304, 400, 401, 403, 429, 405, 415]:
|
if info['status'] not in [200, 304, 400, 401, 403, 429, 405, 415]:
|
||||||
self.module.fail_json(msg="Failed API call {0}; got unexpected HTTP code {1}".format(api_call, info['status']))
|
self.module.fail_json(msg="Failed API call {0}; got unexpected HTTP code {1}: {2}".format(api_call, info['status'], info.get('msg')))
|
||||||
|
|
||||||
error_msg = ''
|
error_msg = ''
|
||||||
if info['status'] == 401:
|
if info['status'] == 401:
|
||||||
|
|
Loading…
Add table
Reference in a new issue