fix: fix configuration schema validation (#520)

This commit is contained in:
Robert Kaussow 2023-01-09 10:53:52 +01:00 committed by GitHub
parent ebcd5e573d
commit cc385df566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,9 +190,13 @@ class Settings(object):
except jsonschema.exceptions.ValidationError as e:
schema_error = (
"Error while loading configuration:\n"
"Failed validating '{validator}' in schema{schema}"
"Failed validating '{validator}' at {path}"
).format(
validator=e.validator, schema=format_as_index(list(e.relative_schema_path)[:-1])
validator=e.validator,
path=format_as_index(
list(e.absolute_path)[0],
list(e.absolute_path)[1:],
)
)
utils.sysexit_with_message(
"{schema}: {msg}".format(schema=schema_error, msg=e.message)