diff --git a/prometheuspvesd/config.py b/prometheuspvesd/config.py index 9bf3c47..84185ea 100644 --- a/prometheuspvesd/config.py +++ b/prometheuspvesd/config.py @@ -285,11 +285,8 @@ class Config: try: anyconfig.validate(config, self.schema, ac_schema_safe=False) except jsonschema.exceptions.ValidationError as e: - schema_error = "Failed validating '{validator}' in schema{schema}\n{message}".format( - validator=e.validator, - schema=format_as_index(list(e.relative_schema_path)[:-1], 0), - message=e.message, - ) + schema = format_as_index(list(e.relative_schema_path)[:-1], 0) + schema_error = f"Failed validating '{e.validator}' in schema {schema}\n{e.message}" raise prometheuspvesd.exception.ConfigError("Configuration error", schema_error) from e return True