@@ -384,6 +384,7 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):
384
384
top_level_dirs may be None (in this case, the constructor will not
385
385
search for a configuration file).
386
386
"""
387
+ config_errors = []
387
388
app_config_location = app_config
388
389
if app_config_location is None :
389
390
for directory in top_level_dirs or []:
@@ -399,8 +400,10 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):
399
400
self .app_config_data = json_file_to_dict (app_config_location ) \
400
401
if app_config_location else {}
401
402
except ValueError as exc :
402
- sys .stderr .write (str (exc ) + "\n " )
403
403
self .app_config_data = {}
404
+ config_errors .append (
405
+ ConfigException ("Could not parse mbed app configuration from %s"
406
+ % app_config_location ))
404
407
405
408
# Check the keys in the application configuration data
406
409
unknown_keys = set (self .app_config_data .keys ()) - \
@@ -433,7 +436,7 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):
433
436
434
437
self ._process_config_and_overrides (self .app_config_data , {}, "app" ,
435
438
"application" )
436
- self .config_errors = None
439
+ self .config_errors = config_errors
437
440
438
441
def add_config_files (self , flist ):
439
442
"""Add configuration files
@@ -806,6 +809,7 @@ def load_resources(self, resources):
806
809
"""
807
810
# Update configuration files until added features creates no changes
808
811
prev_features = set ()
812
+ self .validate_config ()
809
813
while True :
810
814
# Add/update the configuration with any .json files found while
811
815
# scanning
0 commit comments