Skip to content

Commit

Permalink
Clarify errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed May 31, 2023
1 parent 5c59cfd commit d366951
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl Config {
return true;
}

eprintln!("Error: Path is not a file: {:?}", path);
eprintln!("Error: Path is not a regular file: {:?}", path);
false
})
.filter(|path| {
Expand All @@ -410,7 +410,14 @@ impl Config {
eprintln!("Error: Path cannot be serialized to string: {:?}", path);
false
})
.filter(|path| path.file_name() != Some(OsStr::new(hash_file)))
.filter(|path| {
if path.file_name() == Some(OsStr::new(hash_file)) {
eprintln!("Error: File name is the name of a dano hash file: {:?}", path);
return false
}

true
})
.filter_map(|path| {
if !opt_disable_filter {
let opt_extension = path.extension();
Expand Down Expand Up @@ -444,7 +451,7 @@ impl Config {
buffer.push_str(" ");
});

eprintln!("WARNING: The following are extensions which are unknown to dano: {:?}. dano has excluded all files with these extensions. If you know this file type is acceptable to ffmpeg, you may use --disable-filter to force dano to accept its use.", buffer.trim());
eprintln!("WARNING: The following are extensions which are unknown to dano: {:?}. dano has excluded all files with these extensions. If you know these file types are acceptable to ffmpeg, you may use --disable-filter to force dano to accept their use.", buffer.trim());
}

valid_paths.iter().map(|path| {
Expand Down

0 comments on commit d366951

Please sign in to comment.