aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/yt/src/main.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/crates/yt/src/main.rs b/crates/yt/src/main.rs
index 8c67e95..fd7c23b 100644
--- a/crates/yt/src/main.rs
+++ b/crates/yt/src/main.rs
@@ -13,8 +13,9 @@
// to print it anyways.
#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
-use anyhow::{Context, Result};
-use app::App;
+use std::process;
+
+use anyhow::Result;
use clap::{CommandFactory, Parser};
use log::info;
@@ -107,10 +108,20 @@ async fn main() -> Result<()> {
let app = App::new(config, !args.no_migrate_db).await?;
- args.command
- .unwrap_or(Command::default())
- .implm(app)
- .await?;
+ let result = args.command.unwrap_or(Command::default()).implm(app).await;
+
+ // TODO(@bpeetz): I don't know why, but just bubbling the error up with `?` will result in an
+ // infinite hang?
+ // So we manually print and exit, upon receiving an error.
+ // <2026-08-18>
+ if let Err(err) = result {
+ // Print one newline, so that we are sure, we are not printing the error _inside_ of a
+ // started progress bar line.
+ eprintln!();
+
+ eprintln!("{err:?}");
+ process::exit(1);
+ }
Ok(())
}