mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-22 06:13:25 -07:00
If we fail to parse a response, log the uri.
This commit is contained in:
parent
f7bc208fd1
commit
0e4c76275d
1 changed files with 18 additions and 13 deletions
|
@ -88,19 +88,24 @@ class HTTPHandler(object):
|
|||
return None
|
||||
|
||||
if request_status == 200:
|
||||
if output_format == 'dict':
|
||||
output = helpers.convert_xml_to_dict(request_content)
|
||||
elif output_format == 'json':
|
||||
output = helpers.convert_xml_to_json(request_content)
|
||||
elif output_format == 'xml':
|
||||
output = helpers.parse_xml(request_content)
|
||||
else:
|
||||
output = request_content
|
||||
try:
|
||||
if output_format == 'dict':
|
||||
output = helpers.convert_xml_to_dict(request_content)
|
||||
elif output_format == 'json':
|
||||
output = helpers.convert_xml_to_json(request_content)
|
||||
elif output_format == 'xml':
|
||||
output = helpers.parse_xml(request_content)
|
||||
else:
|
||||
output = request_content
|
||||
|
||||
if return_type:
|
||||
return output, content_type
|
||||
if return_type:
|
||||
return output, content_type
|
||||
|
||||
return output
|
||||
return output
|
||||
|
||||
except Exception as e:
|
||||
logger.warn(u"Failed to parse %s to %s %s" % (uri, output_type, e))
|
||||
return None
|
||||
else:
|
||||
logger.warn(u"Failed to access uri endpoint %s. Status code %r" % (uri, request_status))
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue