better error messages if option doesn't exists

This commit is contained in:
2019-08-03 21:27:36 +02:00
parent cfb4eb3b3c
commit 0dc298dedc
2 changed files with 19 additions and 1 deletions

View File

@ -811,12 +811,16 @@ class Config:
subpaths = path.split('.')[len(root):]
else:
subpaths = path.split('.')
current_subpath = 'root'
for subpath in subpaths:
if root_path:
root_path += '.' + subpath
else:
root_path = subpath
schema = schema['properties'][root_path]
schema = schema['properties'].get(root_path)
if schema is None:
raise AttributeError(_(f'option "{subpath}" inconnue dans l\'optiondescription "{current_subpath}"'))
current_subpath = subpath
return schema
def isleader(self,