Trace errors and then panic, if configured

This commit is contained in:
Matthias Beyer 2017-02-10 17:04:39 +01:00
parent 33f4b33d61
commit 2d199ce3ec

View file

@ -353,6 +353,8 @@ impl Store {
/// This function is not intended to be called by normal programs but only by `imag-store`. /// This function is not intended to be called by normal programs but only by `imag-store`.
#[cfg(feature = "verify")] #[cfg(feature = "verify")]
pub fn verify(&self) -> bool { pub fn verify(&self) -> bool {
use libimagerror::trace::trace_error_dbg;
info!("Header | Content length | Path"); info!("Header | Content length | Path");
info!("-------+----------------+-----"); info!("-------+----------------+-----");
@ -381,6 +383,8 @@ impl Store {
}, },
Err(e) => { Err(e) => {
trace_error_dbg(&e);
if_cfg_panic!("Error verifying: {:?}", e);
debug!("{:?}", e); debug!("{:?}", e);
false false
}, },
@ -392,6 +396,8 @@ impl Store {
}, },
Err(e) => { Err(e) => {
trace_error_dbg(&e);
if_cfg_panic!("Error verifying: {:?}", e);
debug!("{:?}", e); debug!("{:?}", e);
false 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 /// This will silently ignore errors, use `Store::update` if you want to catch the errors
fn drop(&mut self) { fn drop(&mut self) {
use libimagerror::trace::trace_error_dbg; use libimagerror::trace::trace_error_dbg;
match self.store._update(self, true) { match self.store._update(self, true) {
Err(e) => { Err(e) => {
trace_error_dbg(&e); trace_error_dbg(&e);