Skip to content

Commit

Permalink
Merge pull request #342 from dreulavelle/fix_invalid_settings_crash
Browse files Browse the repository at this point in the history
Use default settings when the provided settings file can't be parsed
  • Loading branch information
davidemarcoli authored Jun 6, 2024
2 parents fb17afb + 4cca08d commit cc7b931
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/program/settings/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def load(self, settings_dict: dict | None = None):
settings_dict = json.loads(file.read())
self.settings = AppModel.model_validate(settings_dict)
except ValidationError as e:
logger.warning(
f"Error loading settings: {e}, initializing with default settings"
logger.error(
f"Error validating settings: {e}"
)
raise
except json.JSONDecodeError as e:
logger.warning(
f"Error parsing settings file: {e}, initializing with default settings"
logger.error(
f"Error parsing settings file: {e}"
)
raise
except FileNotFoundError:
Expand Down

0 comments on commit cc7b931

Please sign in to comment.