chore: log warning when config cannot be loaded

This commit is contained in:
agatha 2024-09-07 16:31:57 -04:00
parent a3329c0a7f
commit f71d86fce7

View File

@ -1,5 +1,7 @@
import yaml import yaml
from loguru import logger
def load_yaml_config(file_path): def load_yaml_config(file_path):
""" """
@ -19,8 +21,8 @@ def load_yaml_config(file_path):
try: try:
with open(file_path, "r", encoding="utf-8") as f: with open(file_path, "r", encoding="utf-8") as f:
config = yaml.safe_load(f) config = yaml.safe_load(f)
except Exception: except Exception as e:
# TODO: Log error logger.warning(f"Error loading {file_path}: {e}")
config = { config = {
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 9999 "port": 9999