Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: better handeling of YAML errors

NTFSvolume34e8d11d65d6
diff --git a/cyberdrop_dl/config/__init__.py b/cyberdrop_dl/config/__init__.py
index 2bb2e53e3..b5104f2b5 100644
--- a/cyberdrop_dl/config/__init__.py
+++ b/cyberdrop_dl/config/__init__.py
@@ -137,7 +137,7 @@ class Config(ConfigModel, title="cyberdrop-dl config"):
try:
data = yaml.safe_load(content) or {}
except yaml.YAMLError as e:
- raise InvalidYamlError(file, e) from e
+ raise CDLConfigRuntimeErrorsGroup("Invalid YAML file", (InvalidYamlError(file, e),)) from None
config = Config.model_validate(data)
config._source = file
diff --git a/cyberdrop_dl/exceptions.py b/cyberdrop_dl/exceptions.py
index 0cd05bb99..1b51a449b 100644
--- a/cyberdrop_dl/exceptions.py
+++ b/cyberdrop_dl/exceptions.py
@@ -260,7 +260,7 @@ class InvalidYamlError(CDLBaseError):
"""This error will be thrown when a yaml config file has invalid values."""
file = file.resolve()
ui_failure = "Invalid YAML"
- msg = f"File '{file}' is not a valid YAML file"
+ msg = f"'{file}' is not a valid YAML file"
if mark := getattr(e, "problem_mark", None):
msg += f"\n\nThe error was found in this line: \n {mark}"