From 12e9243211d27eaa4d03c0a215bfa5753bde2539 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Tue, 11 May 2021 06:45:44 +0200 Subject: [PATCH] better error messages --- src/ytd.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ytd.rs b/src/ytd.rs index d9f7bf8..c180f76 100644 --- a/src/ytd.rs +++ b/src/ytd.rs @@ -76,7 +76,7 @@ impl YoutubeDL { if !path.exists() { // if not create if let Err(why) = create_dir_all(&path) { - return Err(format!("Error: {:?}", why)); + return Err(format!("Error while creating directories: {:?}", why)); } } @@ -89,7 +89,7 @@ impl YoutubeDL { match canonicalize(dl_path) { // return new youtube-dl job Ok(path) => Ok(YoutubeDL { path, link, args }), - Err(why) => Err(format!("Error: {:?}", why)), + Err(why) => Err(format!("Error creating YouTubeDL: {:?}", why)), } } @@ -97,7 +97,7 @@ impl YoutubeDL { let result = self.spawn_youtube_dl(); if let Err(why) = result { - Err(format!("Error: {:?}", why)) + Err(format!("Error downloading video: {:?}", why)) } else { Ok(&self.path) }