Add more contextual error messages for better error reporting
Bug: 193612136
Test: m
Change-Id: If182768460a69c8a00c408e69e76e0240d0da8b8
diff --git a/apkdmverity/src/main.rs b/apkdmverity/src/main.rs
index 54d5def..321f79a 100644
--- a/apkdmverity/src/main.rs
+++ b/apkdmverity/src/main.rs
@@ -98,7 +98,9 @@
// Parse the idsig file to locate the merkle tree in it, then attach the file to a loop device
// with the offset so that the start of the merkle tree becomes the beginning of the loop
// device.
- let sig = V4Signature::from(File::open(&idsig)?)?;
+ let sig = V4Signature::from(
+ File::open(&idsig).context(format!("Failed to open idsig file {:?}", &idsig))?,
+ )?;
let offset = sig.merkle_tree_offset;
let size = sig.merkle_tree_size as u64;
let hash_device = loopdevice::attach(&idsig, offset, size)?;