mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
@@ -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)
|
||||
|
||||
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 = ''
|
||||
if info['status'] == 401:
|
||||
|
||||
Reference in New Issue
Block a user