Skip to content

Commit

Permalink
persist failure should not panic (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally authored May 17, 2022
1 parent b7e8d06 commit 837785d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions consensus/src/block_storage/block_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
state_replication::StateComputer,
util::time_service::TimeService,
};
use anyhow::{bail, ensure, format_err, Context};
use anyhow::{anyhow, bail, ensure, format_err, Context};
use consensus_types::{
block::Block, executed_block::ExecutedBlock, quorum_cert::QuorumCert, sync_info::SyncInfo,
timeout_certificate::TimeoutCertificate,
Expand Down Expand Up @@ -220,7 +220,8 @@ impl BlockStore {
finality_proof,
)
.await
.expect("Failed to persist commit");
.map_err(|_| anyhow!("Failed to persist commit"))?;

update_counters_for_committed_blocks(&blocks_to_commit);
let current_round = self.root().round();
let committed_round = block_to_commit.round();
Expand Down

0 comments on commit 837785d

Please sign in to comment.