fix bugs + review comments
This commit is contained in:
parent
6876f9bcdc
commit
2e59c4afd1
1 changed files with 15 additions and 14 deletions
|
|
@ -56,21 +56,22 @@ fn main() {
|
|||
eprintln!("Error: {}", err);
|
||||
|
||||
// HACK: ignore timeouts
|
||||
#[allow(unused_mut)]
|
||||
let mut actually_broken = false;
|
||||
|
||||
#[cfg(feature = "linkcheck")]
|
||||
{
|
||||
if let Ok(broken_links) = err.downcast::<BrokenLinks>() {
|
||||
for cause in broken_links.links().iter() {
|
||||
eprintln!("\tCaused By: {}", cause);
|
||||
|
||||
if cause.contains("timed out") {
|
||||
actually_broken = true;
|
||||
}
|
||||
}
|
||||
let actually_broken = {
|
||||
#[cfg(feature = "linkcheck")]
|
||||
{
|
||||
err.downcast::<BrokenLinks>()
|
||||
.unwrap_or(false)
|
||||
.links()
|
||||
.iter()
|
||||
.inspect(|cause| eprintln!("\tCaused By: {}", cause))
|
||||
.any(|cause| !cause.contains("timed out"));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "linkcheck"))]
|
||||
{
|
||||
false
|
||||
}
|
||||
};
|
||||
|
||||
if actually_broken {
|
||||
std::process::exit(101);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue