add main error types

This commit is contained in:
steven-omaha
2023-02-18 15:35:54 +01:00
parent 670f7c9850
commit 729312f8c2
4 changed files with 23 additions and 9 deletions
+1 -4
View File
@@ -19,7 +19,6 @@ use std::process::{ExitCode, Termination};
use anyhow::{Context, Result};
use pacdef_core as core;
use pacdef_core::{get_args, get_config_path, get_group_dir, Config, Group, Pacdef};
fn main() -> ExitCode {
@@ -32,9 +31,7 @@ fn handle_final_result(result: Result<()>) -> ExitCode {
match result {
Ok(_) => ExitCode::SUCCESS,
Err(ref e) => {
let msg = e.root_cause().to_string();
if msg == core::NO_PACKAGES_FOUND {
if e.root_cause().to_string() == pacdef_core::Error::NoPackagesFound.to_string() {
ExitCode::FAILURE
} else {
result.report()