1
0
Fork 0
mirror of synced 2024-12-22 06:01:07 -05:00

Improve error message for malformed files

This patch makes Dotbot warn the user and gracefully exit when the
configuration file is not a list.
This commit is contained in:
Anish Athalye 2015-04-26 19:46:14 -04:00
parent 3a649c1112
commit 3c60899895

View file

@ -35,6 +35,8 @@ def main():
if (options.verbose): if (options.verbose):
log.set_level(Level.DEBUG) log.set_level(Level.DEBUG)
tasks = read_config(options.config_file[0]) tasks = read_config(options.config_file[0])
if not isinstance(tasks, list):
raise ReadingError('Configuration file must be a list of tasks')
dispatcher = Dispatcher(options.base_directory[0]) dispatcher = Dispatcher(options.base_directory[0])
success = dispatcher.dispatch(tasks) success = dispatcher.dispatch(tasks)
if success: if success: