Improve error message

This commit is contained in:
nicolargo 2020-09-19 16:26:57 +02:00
parent 7c074902b3
commit a8d1ba5e43
2 changed files with 6 additions and 1 deletions

View File

@ -297,5 +297,9 @@ def get_stat_from_path(stats, stat_path):
else:
ret = get_stat_from_path(match_dict, stat_path[1:])
else:
ret = get_stat_from_path(stats[stat_path[0]], stat_path[1:])
try:
ret = get_stat_from_path(stats[stat_path[0]], stat_path[1:])
except TypeError:
logger.error(
'Multiple {}, please select one using {}=<foo>'.format(stat_path[0], stat_path[0]))
return ret

View File

@ -50,6 +50,7 @@ class GlancesStdout(object):
get_stat_from_path(stats.get_plugin(plugin).get_export(),
stat_path)))
else:
logger.error('Plugin {} does not exist or is disabled'.format(plugin))
continue
# Wait until next refresh