Skip to content

Commit dd8060b

Browse files
authored
Merge pull request #2433 from theotherjimmy/better-config-errors
[tools] Improve error for missing name from mbed_lib.json
2 parents 6c2ef92 + 71113a8 commit dd8060b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ def add_config_files(self, flist):
240240
# Read the library configuration and add a "__full_config_path" attribute to it
241241
cfg = json_file_to_dict(f)
242242
cfg["__config_path"] = full_path
243+
244+
if "name" not in cfg:
245+
raise ConfigException("Library configured at %s has no name field." % full_path)
243246
# If there's already a configuration for a module with the same name, exit with error
244247
if self.lib_config_data.has_key(cfg["name"]):
245248
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"]))

0 commit comments

Comments
 (0)