Commit dbb84e76 authored by Yuge Zhang's avatar Yuge Zhang Committed by Guoxin
Browse files

Print error detail on schema validation failure

print error detail on schema validation failure
parent ea89e232
...@@ -198,10 +198,7 @@ def validate_common_content(experiment_config): ...@@ -198,10 +198,7 @@ def validate_common_content(experiment_config):
Schema({**separate_schema_dict[separate_key]['customized']}).validate(experiment_config[separate_key]) Schema({**separate_schema_dict[separate_key]['customized']}).validate(experiment_config[separate_key])
except SchemaError as error: except SchemaError as error:
print_error('Your config file is not correct, please check your config file content!') print_error('Your config file is not correct, please check your config file content!')
if error.__str__().__contains__('Wrong key'): print_error(error.code)
print_error(' '.join(error.__str__().split()[:3]))
else:
print_error(error)
exit(1) exit(1)
#set default value #set default value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment