From 4e60f9585462e06307f22d457fa1c4f2ff91889c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 16:33:53 +0000 Subject: [PATCH] Don't squash caught errors, please (#15046) (#15049) * Don't squash caught errors, please * Update blockstore.rs * Update blockstore.rs (cherry picked from commit 8376781ec87a28f371c57c6360d3dae8e4867dd9) Co-authored-by: Ryo Onodera --- ledger/src/blockstore.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 12fda0db55..811f7edc69 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -487,8 +487,9 @@ impl Blockstore { Ok(meta_iter.map(|(slot, slot_meta_bytes)| { ( slot, - deserialize(&slot_meta_bytes) - .unwrap_or_else(|_| panic!("Could not deserialize SlotMeta for slot {}", slot)), + deserialize(&slot_meta_bytes).unwrap_or_else(|e| { + panic!("Could not deserialize SlotMeta for slot {}: {:?}", slot, e) + }), ) })) } @@ -2598,10 +2599,11 @@ impl Blockstore { })?; debug!("{:?} shreds in last FEC set", data_shreds.len(),); - bincode::deserialize::>(&deshred_payload).map_err(|_| { - BlockstoreError::InvalidShredData(Box::new(bincode::ErrorKind::Custom( - "could not reconstruct entries".to_string(), - ))) + bincode::deserialize::>(&deshred_payload).map_err(|e| { + BlockstoreError::InvalidShredData(Box::new(bincode::ErrorKind::Custom(format!( + "could not reconstruct entries: {:?}", + e + )))) }) }