generate_headers.py prints error when JSON file cannot be loaded to localize problem

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-07-06 11:17:45 +02:00
parent 313d13afe9
commit acac55d63c

View File

@@ -187,8 +187,11 @@ def combine_json(root_dir):
path, file_name = os.path.split(file)
fluid_name = file_name.split('.')[0]
# Load the fluid file
fluid = json.load(open(file, 'r'))
try:
# Load the fluid file
fluid = json.load(open(file, 'r'))
except ValueError:
raise ValueError('unable to decode file %s' % file)
master += [fluid]