Handle KeyError

This commit is contained in:
flyingscorpio@arch-desktop 2020-04-28 13:38:16 +02:00
parent 9c49f65d85
commit ebb1652e79

View file

@ -284,7 +284,12 @@ class Installer:
ui.info(ui.green, program)
ui.info("-" * len(program))
todo = self.conf[program]
try:
todo = self.conf[program]
except KeyError:
ui.fatal("'{}' wasn't found in conf file.".format(program))
for action in todo:
name = list(action.keys())[0]
params = action[name]