From 35ec579a06f7f4a1659c0f99485aee70047aee5c Mon Sep 17 00:00:00 2001 From: mxve <68632137+mxve@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:09:45 +0200 Subject: [PATCH] error logging for failed/retry download --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 64f0dab..e5cb3ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -278,13 +278,17 @@ async fn update_dir( ) .await { - println!( - "Failed to download file {}, retry? (Y/n)", - file_path.clone().display() - ); + let file_name = file_path.clone().cute_path(); + println_error!("{err}"); + println!("Failed to download file {file_name}, retry? (Y/n)"); let input = misc::stdin().to_ascii_lowercase(); if input == "n" { + error!("Download for file {file_name} failed with {err}"); panic!("{err}"); + } else { + warn!( + "Download for file {file_name} failed with {err} user chose to retry download" + ); } }; download_complete = true;