mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 08:13:08 +00:00
Pass proper error value to to_text (#33030)
This commit is contained in:
@@ -370,7 +370,7 @@ class CloudflareAPI(object):
|
||||
|
||||
if content:
|
||||
try:
|
||||
result = json.loads(to_text(content, errors='surrogate_then_strict'))
|
||||
result = json.loads(to_text(content, errors='surrogate_or_strict'))
|
||||
except (json.JSONDecodeError, UnicodeError) as e:
|
||||
error_msg += "; Failed to parse API response with error {0}: {1}".format(to_native(e), content)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user