config: Rework error handling into explicit error types
This commit is contained in:
@ -46,7 +46,9 @@ use chrono::DateTime;
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let config = Config::load("bots.yaml").expect("Failed to load config");
|
||||
let config = Config::load("bots.yaml").unwrap_or_else(|e| {
|
||||
panic!("Failed to load config: {e:?}")
|
||||
});
|
||||
let config = Arc::new(config);
|
||||
|
||||
// This message passing channel is used for sending messages to the matrix module,
|
||||
@ -109,7 +111,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
if parsed.ts > state_ts {
|
||||
info!("Entry {} has not been posted yet, sending to matrix", entry.id);
|
||||
let msg = parsed.formatted.unwrap();
|
||||
let msg = parsed.formatted.unwrap(); // XXX
|
||||
bcast_tx.send((msg, rooms.clone())).unwrap();
|
||||
|
||||
max_ts = max(max_ts, parsed.ts);
|
||||
|
Reference in New Issue
Block a user