From e71f32ca6193b2ceef6e8e00a823ec840dc9faf3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 20 Dec 2021 09:32:19 -0500 Subject: [PATCH] Fix for #529 --- modules/notifiarr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/notifiarr.py b/modules/notifiarr.py index b69a2b65..d4262b39 100644 --- a/modules/notifiarr.py +++ b/modules/notifiarr.py @@ -1,4 +1,5 @@ import logging +from json import JSONDecodeError from modules.util import Failed @@ -16,7 +17,10 @@ class Notifiarr: self.test = params["test"] url, _ = self.get_url("user/validate/") response = self.config.get(url) - response_json = response.json() + try: + response_json = response.json() + except JSONDecodeError as e: + raise Failed(e) if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): logger.debug(f"Response: {response_json}") raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")