mirror of
https://github.com/narrrl/ytd-rs.git
synced 2026-11-04 00:47:02 +01:00
better error messages
This commit is contained in:
1 parent
c1ac507152
commit
12e9243211
1 file changed
+3
-3
+3
-3
@@ -76,7 +76,7 @@ impl YoutubeDL {
|
|||||||
if !path.exists() {
|
if !path.exists() {
|
||||||
// if not create
|
// if not create
|
||||||
if let Err(why) = create_dir_all(&path) {
|
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) {
|
match canonicalize(dl_path) {
|
||||||
// return new youtube-dl job
|
// return new youtube-dl job
|
||||||
Ok(path) => Ok(YoutubeDL { path, link, args }),
|
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();
|
let result = self.spawn_youtube_dl();
|
||||||
|
|
||||||
if let Err(why) = result {
|
if let Err(why) = result {
|
||||||
Err(format!("Error: {:?}", why))
|
Err(format!("Error downloading video: {:?}", why))
|
||||||
} else {
|
} else {
|
||||||
Ok(&self.path)
|
Ok(&self.path)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user