[BACKEND] Include yaml exception in error

This commit is contained in:
Jesse Bannon 2023-07-29 00:03:23 -07:00
parent 5f9b8afc4b
commit 6046d8f629

View file

@ -38,9 +38,9 @@ def load_yaml(file_path: str | Path) -> Dict:
with open(file_path, "r", encoding="utf-8") as file:
output = yaml.safe_load(file)
except YAMLError as yaml_exception:
logger.debug(yaml_exception)
raise InvalidYamlException(
f"'{file_path}' has invalid YAML, copy-paste it into a YAML checker to find the issue."
f"'{file_path}' has invalid YAML:\n{yaml_exception}\n\n"
f"Copy-pasting it into a YAML parser can also help find the issue."
) from yaml_exception
if not isinstance(output, dict):