Skip to content

Commit

Permalink
added try catch for JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
Aalex authored and Aalex committed Nov 17, 2019
1 parent 65db50d commit 6849724
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ def process_show_section(s):
logging.error("Show [{} ({})]: Did not find on Trakt. Aborting. GUID: {}".format(show.title, show.year, guid))
continue
with requests_cache.disabled():
trakt_watched = pytrakt_extensions.watched(trakt_show.slug)
trakt_collected = pytrakt_extensions.collected(trakt_show.slug)
try:
trakt_watched = pytrakt_extensions.watched(trakt_show.slug)
trakt_collected = pytrakt_extensions.collected(trakt_show.slug)
except JSONDecodeError:
logging.error("Show [{} ({})]: JSONDecodeError. Aborting".format(show.title, show.year))
continue
start_time = time()
# this lookup-table is accessible via lookup[season][episode]
with requests_cache.disabled():
Expand Down

0 comments on commit 6849724

Please sign in to comment.