From 0453c8530c0b641fce2265f0d2d8adb2a1e82a7f Mon Sep 17 00:00:00 2001 From: Nevah5 Date: Sat, 30 Mar 2024 20:26:29 +0100 Subject: [PATCH 1/2] Added debug exception print when reading config.json --- cloudflare-ddns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index d6a974a..6b878da 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -261,8 +261,8 @@ def updateIPs(ips): try: with open(os.path.join(CONFIG_PATH, "config.json")) as config_file: config = json.loads(config_file.read()) - except: - print("😡 Error reading config.json") + except Exception as e: + print(f"😡 Error reading config.json {str(e)}") # wait 10 seconds to prevent excessive logging on docker auto restart time.sleep(10) From 6d3b91ac7a375d2a6d7fc167fb0045286f0edd00 Mon Sep 17 00:00:00 2001 From: Nevah5 Date: Tue, 3 Sep 2024 18:10:25 +0200 Subject: [PATCH 2/2] Fixed exception variable --- cloudflare-ddns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index 2ea0413..5d89909 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -267,7 +267,7 @@ def updateIPs(ips): config = json.loads(Template(config_file.read()).safe_substitute(ENV_VARS)) else: config = json.loads(config_file.read()) - except: + except Exception as e: print(f"😡 Error reading config.json {str(e)}") # wait 10 seconds to prevent excessive logging on docker auto restart time.sleep(10)