fix(config): add logging for config parse errors (#4955)

Co-authored-by: alihassan <239741857+alidevh@users.noreply.github.com>
This commit is contained in:
alidevh
2026-03-05 15:22:34 +05:00
committed by GitHub
parent 9c0f56f027
commit 29a3ae471f
2 changed files with 31 additions and 1 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ helper functions.
"""
import json
import logging
import os
from dataclasses import dataclass, field
from pathlib import Path
@@ -18,6 +19,7 @@ from framework.graph.edge import DEFAULT_MAX_TOKENS
# ---------------------------------------------------------------------------
HIVE_CONFIG_FILE = Path.home() / ".hive" / "configuration.json"
logger = logging.getLogger(__name__)
def get_hive_config() -> dict[str, Any]:
@@ -27,7 +29,12 @@ def get_hive_config() -> dict[str, Any]:
try:
with open(HIVE_CONFIG_FILE, encoding="utf-8-sig") as f:
return json.load(f)
except (json.JSONDecodeError, OSError):
except (json.JSONDecodeError, OSError) as e:
logger.warning(
"Failed to load Hive config %s: %s",
HIVE_CONFIG_FILE,
e,
)
return {}