From 2f825fd6f648f7969b0de5420ec2a38dc7e1fbed Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 19 Dec 2012 15:07:59 +0200 Subject: [PATCH] BmapCopy: make error message more verbose Print all file names in case of short read/write error. Change-Id: If86e676541371d246f4202a736604d4024cbe6b6 Signed-off-by: Artem Bityutskiy --- bmaptools/BmapCopy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index 94a572c..9693c7d 100644 --- a/bmaptools/BmapCopy.py +++ b/bmaptools/BmapCopy.py @@ -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 -- 2.7.4