Pass proper error value to to_text (#33030)
This commit is contained in:
parent
2ef438c962
commit
1980c9e773
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue