From 5ca65f47977ab8194ca2d4abab7daebe3acbe1b5 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 19 Jan 2018 07:13:53 -0800 Subject: [PATCH] Catch json ValueError in metadata cache --- plexpy/pmsconnect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 2733c19c..a8a58c7e 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -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))