Merge branch 'dev' into webserver-sorting

This commit is contained in:
Jesse Hills 2024-05-10 10:58:02 +12:00 committed by GitHub
commit 87a3902c4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -148,6 +148,8 @@ class Config(OrderedDict, fv.FinalValidateConfig):
path = path or []
try:
yield
except cv.FinalExternalInvalid as e:
self.add_error(e)
except vol.Invalid as e:
e.prepend(path)
self.add_error(e)

View File

@ -267,6 +267,10 @@ class Required(vol.Required):
super().__init__(key, msg=msg)
class FinalExternalInvalid(Invalid):
"""Represents an invalid value in the final validation phase where the path should not be prepended."""
def check_not_templatable(value):
if isinstance(value, Lambda):
raise Invalid("This option is not templatable!")