Browse Source

handle errors better in main

feat/mass-publish-tool
Jonathan Strong 1 year ago
parent
commit
8b57bf70b0
  1. 8
      src/main.rs

8
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)]

Loading…
Cancel
Save