Catch exceptions when saving config

This commit is contained in:
Lukáš Kucharczyk 2024-07-30 13:32:26 +02:00
parent 945c69baf0
commit c357cfb6a5
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 5 additions and 1 deletions

View File

@ -125,7 +125,11 @@ def load(configFolder=None):
except Exception: except Exception:
settings = deepcopy(DEFAULTS) settings = deepcopy(DEFAULTS)
if check(settings) > 0: save(settings, configFolder) # Check the settings and save them if something changed if check(settings) > 0:
try:
save(settings, configFolder) # Check the settings and save them if something changed
except:
print(f"Error saving config file {configFile.name}, continuing without saving.")
return settings return settings
def check(settings): def check(settings):