[Enhancement] Enhance the output of exception (#1309)

pull/1327/head
Zaida Zhou 2021-09-07 19:35:53 +08:00 committed by GitHub
parent 4f4eb27514
commit eed9cced8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -251,8 +251,10 @@ class Config:
base_cfg_dict = dict()
for c in cfg_dict_list:
if len(base_cfg_dict.keys() & c.keys()) > 0:
raise KeyError('Duplicate key is not allowed among bases')
duplicate_keys = base_cfg_dict.keys() & c.keys()
if len(duplicate_keys) > 0:
raise KeyError('Duplicate key is not allowed among bases. '
f'Duplicate keys: {duplicate_keys}')
base_cfg_dict.update(c)
# Subtitute base variables from strings to their actual values