Use downcast_ref for errors
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -397,13 +397,9 @@ fn main() {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
match error
|
if (error.downcast_ref::<StepFailed>().is_some()) || (error.downcast_ref::<Interrupted>().is_some()) {
|
||||||
.downcast::<StepFailed>()
|
} else {
|
||||||
.map(|_| ())
|
println!("ERROR: {}", error)
|
||||||
.or_else(|error| error.downcast::<Interrupted>().map(|_| ()))
|
|
||||||
{
|
|
||||||
Ok(_) => (),
|
|
||||||
Err(error) => println!("ERROR: {}", error),
|
|
||||||
}
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user