clean up main error handling
This commit is contained in:
+5
-4
@@ -31,10 +31,11 @@ fn handle_final_result(result: Result<()>) -> ExitCode {
|
|||||||
match result {
|
match result {
|
||||||
Ok(_) => ExitCode::SUCCESS,
|
Ok(_) => ExitCode::SUCCESS,
|
||||||
Err(ref e) => {
|
Err(ref e) => {
|
||||||
if e.root_cause().to_string() == pacdef_core::Error::NoPackagesFound.to_string() {
|
let root_e = e.root_cause().downcast_ref();
|
||||||
ExitCode::FAILURE
|
match root_e {
|
||||||
} else {
|
Some(pacdef_core::Error::NoPackagesFound) => ExitCode::FAILURE,
|
||||||
result.report()
|
Some(_) => ExitCode::FAILURE,
|
||||||
|
None => result.report(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user