Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubConfig now catches failures and warnings #2710

Merged
merged 2 commits into from Mar 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions mkdocs/config/config_options.py
Expand Up @@ -59,8 +59,11 @@ def validate(self, value):
return self.run_validation(value)

def run_validation(self, value):
Config.validate(self)
return self
failed, self.warnings = Config.validate(self)
if len(failed) > 0:
# get the first failing one
key, err = failed[0]
raise ValidationError(f"Sub-option {key!r} configuration error: {err}")
smarie marked this conversation as resolved.
Show resolved Hide resolved


class ConfigItems(BaseConfigOption):
Expand Down