Catch json ValueError in metadata cache

This commit is contained in:
JonnyWong16 2018-01-19 07:13:53 -08:00
parent d2fccbde68
commit 5ca65f4797

View file

@ -537,7 +537,7 @@ class PmsConnect(object):
try:
with open(in_file_path, 'r') as inFile:
metadata = json.load(inFile)
except IOError as e:
except (IOError, ValueError) as e:
pass
if metadata:
@ -1162,7 +1162,7 @@ class PmsConnect(object):
try:
with open(out_file_path, 'w') as outFile:
json.dump(metadata, outFile)
except IOError as e:
except (IOError, ValueError) as e:
logger.error(u"Tautulli Pmsconnect :: Unable to create cache file for metadata (sessionKey %s): %s"
% (cache_key, e))