1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Jonas 2020-06-15 20:53:04 +02:00 committed by GitHub
parent 689a25edcf
commit 6c59811bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- cloudflare_dns - Report unexpected failure with more detail (https://github.com/ansible-collections/community.general/pull/511).

View file

@ -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: