Use downcast_ref for errors

This commit is contained in:
Roey Darwish Dror
2018-11-07 10:18:18 +02:00
parent 9f52d7b1e2
commit ed8a842439

View File

@@ -397,13 +397,9 @@ fn main() {
exit(0);
}
Err(error) => {
match error
.downcast::<StepFailed>()
.map(|_| ())
.or_else(|error| error.downcast::<Interrupted>().map(|_| ()))
{
Ok(_) => (),
Err(error) => println!("ERROR: {}", error),
if (error.downcast_ref::<StepFailed>().is_some()) || (error.downcast_ref::<Interrupted>().is_some()) {
} else {
println!("ERROR: {}", error)
}
exit(1);
}