From 3c60899895536d3afbf32f0950f0d1a34a6383ed Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Sun, 26 Apr 2015 19:46:14 -0400 Subject: [PATCH] Improve error message for malformed files This patch makes Dotbot warn the user and gracefully exit when the configuration file is not a list. --- dotbot/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotbot/cli.py b/dotbot/cli.py index fffc017..dc90909 100644 --- a/dotbot/cli.py +++ b/dotbot/cli.py @@ -35,6 +35,8 @@ def main(): if (options.verbose): log.set_level(Level.DEBUG) 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]) success = dispatcher.dispatch(tasks) if success: