properly log torrent errors
This commit is contained in:
parent
3867bcbdae
commit
b3dc24c3b8
1 changed files with 10 additions and 4 deletions
14
src/main.rs
14
src/main.rs
|
@ -37,11 +37,17 @@ fn main() {
|
||||||
);
|
);
|
||||||
debug!("Torrent files: {}", torrent_files.join(", "));
|
debug!("Torrent files: {}", torrent_files.join(", "));
|
||||||
|
|
||||||
let torrents = torrent_files
|
let torrents: Vec<(&str, Torrent)> = torrent_files
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|f| Torrent::read_from_file(f).map(|t| (f, t)))
|
.map(|path| (path, Torrent::read_from_file(path)))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.filter_map(|(path, torrent)| match torrent {
|
||||||
.unwrap();
|
Ok(torrent) => Some((path, torrent)),
|
||||||
|
Err(err) => {
|
||||||
|
error!("Error loading \"{path}\"! {err}");
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
for dir_entry in WalkDir::new(search_path).into_iter() {
|
for dir_entry in WalkDir::new(search_path).into_iter() {
|
||||||
if let Ok(dir_entry) = dir_entry {
|
if let Ok(dir_entry) = dir_entry {
|
||||||
|
|
Loading…
Reference in a new issue