//! Error types for the Arc package manager library

use thiserror::Error;

pub type Result<T> = std::result::Result<T, ArcError>;

#[derive(Error, Debug)]
pub enum ArcError {
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("JSON parsing error: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Package not found: {0}")]
    PackageNotFound(String),

    #[error("Package is blacklisted: {0}")]
    PackageBlacklisted(String),

    #[error("Package is not whitelisted: {0}")]
    PackageNotWhitelisted(String),

    #[error("Command execution failed: {0}")]
    CommandFailed(String),

    #[error("Configuration error: {0}")]
    ConfigError(String),

    #[error("Invalid package name: {0}")]
    InvalidPackageName(String),
}
