report section name when asserting bad format

It is good to know what exact layout section is in error when the
conflicting setting assertion is raised.

TEST=tried running with an incorrect json file, observed
     section name reported in the error message.

Change-Id: I4ba7d60913414c8ea681c10410aa9d45da67e9ce
Signed-off-by: Vadim Bendebury <>
Reviewed-by: Daniel Ehrenberg <>
diff --git a/build_library/ b/build_library/
index 76649aa..dae645b 100755
--- a/build_library/
+++ b/build_library/
@@ -340,8 +340,9 @@
         if 'size' in part:
           if 'blocks' in part:
             raise ConflictingOptions(
-                'Conflicting settings are used. '
-                'Found section sets both \'blocks\' and \'size\'.')
+                '%s: Conflicting settings are used. '
+                'Found section sets both \'blocks\' and \'size\'.' %
+                part['label'])
           part['bytes'] = ParseHumanNumber(part['size'])
           part['blocks'] = part['bytes'] / metadata['block_size']