diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index eb9fb4a8..b92e06fb 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -244,6 +244,18 @@ fn apply_set_cookie(pairs: &mut Vec<(String, String)>, set_cookie: &str) -> bool
}
}
+/// Joins an error with its full `.source()` chain, so a wrapper like reqwest's "error sending
+/// request for url" comes with the DNS/TLS/connection failure underneath it instead of hiding it.
+fn error_cause_chain(error: &dyn std::error::Error) -> String {
+ let mut parts = vec![error.to_string()];
+ let mut source = error.source();
+ while let Some(cause) = source {
+ parts.push(cause.to_string());
+ source = cause.source();
+ }
+ parts.join(" -> caused by: ")
+}
+
fn is_youtube_cookie_host(url: &url::Url) -> bool {
url.host_str()
.is_some_and(|host| host == "youtube.com" || host.ends_with(".youtube.com"))
@@ -1707,12 +1719,27 @@ fn load_youtube_music_cookie_entries() -> Result