Don't squash caught errors, please (#15046) (#15048)

* Don't squash caught errors, please

* Update blockstore.rs

* Update blockstore.rs

(cherry picked from commit 8376781ec8)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
mergify[bot]
2021-02-03 16:04:58 +00:00
committed by GitHub
parent c440b6df99
commit b9f71f55e8

View File

@ -477,8 +477,9 @@ impl Blockstore {
Ok(meta_iter.map(|(slot, slot_meta_bytes)| { Ok(meta_iter.map(|(slot, slot_meta_bytes)| {
( (
slot, slot,
deserialize(&slot_meta_bytes) deserialize(&slot_meta_bytes).unwrap_or_else(|e| {
.unwrap_or_else(|_| panic!("Could not deserialize SlotMeta for slot {}", slot)), panic!("Could not deserialize SlotMeta for slot {}: {:?}", slot, e)
}),
) )
})) }))
} }
@ -2594,10 +2595,11 @@ impl Blockstore {
})?; })?;
debug!("{:?} shreds in last FEC set", data_shreds.len(),); debug!("{:?} shreds in last FEC set", data_shreds.len(),);
bincode::deserialize::<Vec<Entry>>(&deshred_payload).map_err(|_| { bincode::deserialize::<Vec<Entry>>(&deshred_payload).map_err(|e| {
BlockstoreError::InvalidShredData(Box::new(bincode::ErrorKind::Custom( BlockstoreError::InvalidShredData(Box::new(bincode::ErrorKind::Custom(format!(
"could not reconstruct entries".to_string(), "could not reconstruct entries: {:?}",
))) e
))))
}) })
} }