mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2433 from theotherjimmy/better-config-errors
[tools] Improve error for missing name from mbed_lib.jsonpull/2266/merge
commit
dd8060b798
|
|
@ -240,6 +240,9 @@ class Config:
|
||||||
# Read the library configuration and add a "__full_config_path" attribute to it
|
# Read the library configuration and add a "__full_config_path" attribute to it
|
||||||
cfg = json_file_to_dict(f)
|
cfg = json_file_to_dict(f)
|
||||||
cfg["__config_path"] = full_path
|
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 there's already a configuration for a module with the same name, exit with error
|
||||||
if self.lib_config_data.has_key(cfg["name"]):
|
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"]))
|
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"]))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue