// SPDX-FileCopyrightText: 2023 CELESTIFYX Team
// SPDX-License-Identifier: GPL-3.0-or-later

use std::path::PathBuf;

use super::{
    ports::ScanError,
    repo::RepoError,
    runtime::RuntimeError
};

#[derive(Debug, thiserror::Error)]
pub(super) enum AppError {
    #[error("This program must be run as root")]
    NotRoot,
    #[error("No enabled repos found in {}", 0)]
    NoRepos(PathBuf),
    #[error("No ports found in any repo")]
    NoPorts,
    #[error(transparent)]
    Repo(#[from] RepoError),
    #[error(transparent)]
    Scan(#[from] ScanError),
    #[error(transparent)]
    Runtime(#[from] RuntimeError)
}
