From c4d8a308b1e9677e276cc736bd8334be5ea3ae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Thu, 11 Jul 2024 16:41:38 +0100 Subject: [PATCH] chore: Fix error handling in Config.py when checking for changes and first config saved --- src/autoconf/Config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/autoconf/Config.py b/src/autoconf/Config.py index c617e231d..cf862837f 100644 --- a/src/autoconf/Config.py +++ b/src/autoconf/Config.py @@ -80,9 +80,15 @@ class Config: i = 0 while i < 60: curr_changes = self._db.check_changes() + first_config_saved = self._db.is_first_config_saved() if isinstance(curr_changes, str): if not startup: self.__logger.error(f"An error occurred when checking for changes in the database : {curr_changes}") + elif isinstance(first_config_saved, str): + if not startup: + self.__logger.error(f"An error occurred when checking if the first config is saved in the database : {first_config_saved}") + elif not first_config_saved: + self.__logger.warning("First configuration is not saved yet, retrying in 5 seconds ...") elif not any(curr_changes.values()): break else: