From 7b8983bb3429d7c02d4a882b7648cccf4b33a4f3 Mon Sep 17 00:00:00 2001 From: Xiao Ji Ji Date: Mon, 16 Mar 2026 06:38:13 +0000 Subject: [PATCH] fix: replace bare except with json.JSONDecodeError in app_settings.py Changed bare except clause to catch json.JSONDecodeError specifically when loading user settings JSON file. This ensures that: - Only JSON parsing errors are caught (not SystemExit, KeyboardInterrupt) - Debugging is easier as unexpected errors will propagate - Follows Python best practices for exception handling --- app/app_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app_settings.py b/app/app_settings.py index c7ac73bf6..6fd2fbaff 100644 --- a/app/app_settings.py +++ b/app/app_settings.py @@ -21,7 +21,7 @@ class AppSettings(): try: with open(file) as f: return json.load(f) - except: + except json.JSONDecodeError: logging.error(f"The user settings file is corrupted: {file}") return {} else: