aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/yt/src/subscribe/mod.rs23
1 files changed, 16 insertions, 7 deletions
diff --git a/crates/yt/src/subscribe/mod.rs b/crates/yt/src/subscribe/mod.rs
index ad074fb..66797e8 100644
--- a/crates/yt/src/subscribe/mod.rs
+++ b/crates/yt/src/subscribe/mod.rs
@@ -13,7 +13,7 @@ use std::str::FromStr;
use anyhow::{Context, Result, bail};
use futures::FutureExt;
-use log::warn;
+use log::{error, warn};
use tokio::io::{AsyncBufRead, AsyncBufReadExt};
use url::Url;
use yt_dlp::{json_cast, json_get, options::YoutubeDLOptions};
@@ -121,17 +121,26 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()>
out?;
} else {
- actual_subscribe(app, None, url.join("videos/").unreachable("See above."))
+ let _ = actual_subscribe(app, None, url.join("videos/").unreachable("See above."))
.await
- .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Videos}"))?;
+ .map_err(|err| {
+ error!("Failed to subscribe to the '{}' variant: {err}", "{Videos}");
+ });
- actual_subscribe(app, None, url.join("streams/").unreachable("See above."))
+ let _ = actual_subscribe(app, None, url.join("streams/").unreachable("See above."))
.await
- .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Streams}"))?;
+ .map_err(|err| {
+ error!(
+ "Failed to subscribe to the '{}' variant: {err}",
+ "{Streams}"
+ );
+ });
- actual_subscribe(app, None, url.join("shorts/").unreachable("See above."))
+ let _ = actual_subscribe(app, None, url.join("shorts/").unreachable("See above."))
.await
- .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Shorts}"))?;
+ .map_err(|err| {
+ error!("Failed to subscribe to the '{}' variant: {err}", "{Shorts}");
+ });
}
} else {
actual_subscribe(app, name, url).await?;