Issues: skip & warn about any Issue that fails to parse
This lets us at least handle the other, valid issues, while informing the user about the ones we don't understand.
This commit is contained in:
parent
2ba13ebaeb
commit
97a575316e
1 changed files with 13 additions and 2 deletions
|
|
@ -56,8 +56,19 @@ impl Issues {
|
|||
for direntry in dir.read_dir()? {
|
||||
if let Ok(direntry) = direntry {
|
||||
if direntry.metadata()?.is_dir() {
|
||||
let issue = crate::issue::Issue::new_from_dir(direntry.path().as_path())?;
|
||||
issues.add_issue(issue);
|
||||
match crate::issue::Issue::new_from_dir(direntry.path().as_path()) {
|
||||
Err(e) => {
|
||||
println!(
|
||||
"failed to parse issue {}, skipping",
|
||||
direntry.file_name().to_string_lossy()
|
||||
);
|
||||
println!("ignoring error: {:?}", e);
|
||||
continue;
|
||||
}
|
||||
Ok(issue) => {
|
||||
issues.add_issue(issue);
|
||||
}
|
||||
}
|
||||
} else if direntry.file_name() == "config.toml" {
|
||||
issues.parse_config(direntry.path().as_path())?;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue