Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

quality: Enhance config parsing error

Clémence Lesné458333710e7e
diff --git a/helpers/config.py b/helpers/config.py
index f66da87..6c8777e 100644
--- a/helpers/config.py
+++ b/helpers/config.py
@@ -36,7 +36,7 @@ else:
with open(path, "r", encoding="utf-8") as f:
CONFIG = RootModel.model_validate(yaml.safe_load(f))
except ValidationError as e:
- raise ConfigBadFormat(f"Config values are not valid") from e
+ raise ConfigBadFormat(f"Config values are not valid: {e.errors()}")
except Exception as e:
raise ConfigBadFormat(f"Config YAML format is not valid") from e
print(f'Config "{path}" loaded')