From 64f854fc5134452a559e835669f1f0c868a468fb Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 11 Feb 2021 01:11:48 -0500 Subject: [PATCH] more logging changes --- modules/radarr.py | 4 +--- modules/sonarr.py | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/radarr.py b/modules/radarr.py index 83e91286..a0257edf 100644 --- a/modules/radarr.py +++ b/modules/radarr.py @@ -83,9 +83,7 @@ class RadarrAPI: logger.error("Radarr Error: ({}) {}: ({}) {}".format(tmdb_id, movie.title, response.status_code, response.json()[0]["errorMessage"])) except KeyError as e: logger.debug(url_json) - logger.debug(response) - logger.debug(response.status_code) - logger.debug(response.json()) + logger.error("Radarr Error: {}".format(response.json())) logger.info("{} Movie{} added to Radarr".format(add_count, "s" if add_count > 1 else "")) @retry(stop_max_attempt_number=6, wait_fixed=10000) diff --git a/modules/sonarr.py b/modules/sonarr.py index 5a959288..1351ebcb 100644 --- a/modules/sonarr.py +++ b/modules/sonarr.py @@ -70,7 +70,11 @@ class SonarrAPI: logger.info("Added to Sonarr | {:<6} | {}".format(tvdb_id, show.title)) add_count += 1 else: - logger.error("Sonarr Error: ({}) {}: ({}) {}".format(tvdb_id, show.title, response.status_code, response.json()[0]["errorMessage"])) + try: + logger.error("Sonarr Error: ({}) {}: ({}) {}".format(tvdb_id, show.title, response.status_code, response.json()[0]["errorMessage"])) + except KeyError as e: + logger.debug(url_json) + logger.error("Sonarr Error: {}".format(response.json())) logger.info("{} Show{} added to Sonarr".format(add_count, "s" if add_count > 1 else "")) @retry(stop_max_attempt_number=6, wait_fixed=10000)