BmapCopy: make error message more verbose
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 19 Dec 2012 13:07:59 +0000 (15:07 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 19 Dec 2012 13:43:50 +0000 (15:43 +0200)
Print all file names in case of short read/write error.

Change-Id: If86e676541371d246f4202a736604d4024cbe6b6
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapCopy.py

index 94a572c..9693c7d 100644 (file)
@@ -447,8 +447,10 @@ class BmapCopy:
         # This is just a sanity check - we should have written exactly
         # 'mapped_cnt' blocks.
         if blocks_written != self.mapped_cnt:
-            raise Error("wrote %u blocks, but should have %u - inconsistent " \
-                       "bmap file" % (blocks_written, self.mapped_cnt))
+            raise Error("wrote %u blocks from image '%s' to '%s', but should " \
+                        "have %u - inconsistent bmap file '%s'" \
+                        % (blocks_written, self._image_path, self._dest_path, \
+                           self.mapped_cnt, self._bmap_path))
 
         if self._dest_is_regfile:
             # Make sure the destination file has the same size as the image