From 3fee20f0cf3ecf03e44d288b91dd36ad5390e708 Mon Sep 17 00:00:00 2001 From: mirsal Date: Thu, 15 May 2025 21:01:59 +0000 Subject: [PATCH] main: Panic explicitely when failing to initialize the state db --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0bffc6c..3c99126 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,13 +51,14 @@ async fn main() -> anyhow::Result<()> { }); let config = Arc::new(config); + let state_db = FeedReaderStateDb::new("state.yaml").await.unwrap_or_else(|e| { + panic!("Failed to initialize feed reader state db: {e:?}") + }); + // This message passing channel is used for sending messages to the matrix module, // it holds a tuple with an HTML message and a list of rooms to post to let (bcast_tx, bcast_rx) = broadcast::channel(1024); - let state_db = FeedReaderStateDb::new("state.yaml").await - .expect("Failed to initialize feed reader state db"); - let handles: Vec> = config.feeds.clone().into_iter().map(|feed_config| { let state_db = Arc::clone(&state_db); let bcast_tx = bcast_tx.clone();