From 2d199ce3ec54a21f327b364e44d7e54a5522c9cb Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 10 Feb 2017 17:04:39 +0100 Subject: [PATCH] Trace errors and then panic, if configured --- libimagstore/src/store.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index c27af3c1..43409ff6 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -353,6 +353,8 @@ impl Store { /// This function is not intended to be called by normal programs but only by `imag-store`. #[cfg(feature = "verify")] pub fn verify(&self) -> bool { + use libimagerror::trace::trace_error_dbg; + info!("Header | Content length | Path"); info!("-------+----------------+-----"); @@ -381,6 +383,8 @@ impl Store { }, Err(e) => { + trace_error_dbg(&e); + if_cfg_panic!("Error verifying: {:?}", e); debug!("{:?}", e); false }, @@ -392,6 +396,8 @@ impl Store { }, Err(e) => { + trace_error_dbg(&e); + if_cfg_panic!("Error verifying: {:?}", e); debug!("{:?}", e); false }, @@ -943,7 +949,6 @@ impl<'a> Drop for FileLockEntry<'a> { /// This will silently ignore errors, use `Store::update` if you want to catch the errors fn drop(&mut self) { use libimagerror::trace::trace_error_dbg; - match self.store._update(self, true) { Err(e) => { trace_error_dbg(&e);