diff --git a/src/main.rs b/src/main.rs index 7dd429d..cee6bb3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -771,7 +771,7 @@ async fn run(config: Config) -> Result<(), AnyError> { Ok(()) } -fn main() { +fn main() -> Result<(), anyhow::Error> { let begin = Instant::now(); dotenvy::dotenv().ok(); @@ -786,9 +786,13 @@ fn main() { .build() .unwrap(); - rt.block_on(run(config)).unwrap(); + if let Err(err) = rt.block_on(run(config)) { + error!(?err, "something went wrong!"); + anyhow::bail!("fatal error: {:?}", err); + } info!("finished in {:?}", begin.elapsed()); + Ok(()) } #[cfg(test)]