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
This commit is contained in:
Xiao Ji Ji 2026-03-16 06:38:13 +00:00
parent 47f60527e2
commit 7b8983bb34

View File

@ -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: