Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: refactor error for pre-context
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <simon.paitrault@gmail.com>
  • Loading branch information
Freyskeyd committed Dec 15, 2023
1 parent 025e252 commit 7b42f9a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/topos-tce/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use futures::StreamExt;
use opentelemetry::global;
use std::{
future::IntoFuture,
panic::UnwindSafe,
sync::{atomic::AtomicBool, Arc},
};
use tokio::{
Expand Down Expand Up @@ -120,15 +121,18 @@ pub async fn run(

let certificates_synced = fullnode_store
.count_certificates_delivered()
.expect("Unable to count certificates delivered");
.map_err(|error| format!("Unable to count certificates delivered: {error}"))
.unwrap();

let pending_certificates = validator_store
.count_pending_certificates()
.expect("Unable to count pending certificates");
.map_err(|error| format!("Unable to count pending certificates: {error}"))
.unwrap();

let precedence_pool_certificates = validator_store
.count_precedence_pool_certificates()
.expect("Unable to count precedence pool certificates");
.map_err(|error| format!("Unable to count precedence pool certificates: {error}"))
.unwrap();

info!(
"Storage initialized with {} certificates delivered, {} pending certificates and {} \
Expand Down

0 comments on commit 7b42f9a

Please sign in to comment.