From 71113a88203a2e7ce1d86d9653966aa94a56e92f Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Thu, 11 Aug 2016 16:05:40 -0500 Subject: [PATCH] Improve error for missing name from mbed_lib.json --- tools/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/config.py b/tools/config.py index 905bc20b6e..053c7d850b 100644 --- a/tools/config.py +++ b/tools/config.py @@ -240,6 +240,9 @@ class Config: # Read the library configuration and add a "__full_config_path" attribute to it cfg = json_file_to_dict(f) cfg["__config_path"] = full_path + + if "name" not in cfg: + raise ConfigException("Library configured at %s has no name field." % full_path) # If there's already a configuration for a module with the same name, exit with error if self.lib_config_data.has_key(cfg["name"]): raise ConfigException("Library name '%s' is not unique (defined in '%s' and '%s')" % (cfg["name"], full_path, self.lib_config_data[cfg["name"]]["__config_path"]))