mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-22 01:23:43 +08:00
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:
parent
47f60527e2
commit
7b8983bb34
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user