use thiserror::Error;

/// Main error type for apt-ostree operations
#[derive(Error, Debug)]
pub enum AptOstreeError {
    #[error("System error: {0}")]
    System(String),
    
    #[error("APT error: {0}")]
    Apt(String),
    
    #[error("OSTree error: {0}")]
    Ostree(String),
    
    #[error("Security error: {0}")]
    Security(String),
    
    #[error("Permission denied: {0}")]
    PermissionDenied(String),
    
    #[error("Transaction error: {0}")]
    Transaction(String),
    
    #[error("Configuration error: {0}")]
    Configuration(String),
    
    #[error("Network error: {0}")]
    Network(String),
    
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),
    
    #[error("Package not found: {0}")]
    PackageNotFound(String),
    
    #[error("Invalid argument: {0}")]
    InvalidArgument(String),
    
    #[error("Daemon error: {0}")]
    DaemonError(String),
    
    #[error("No changes made")]
    NoChange,
}

/// Result type for apt-ostree operations
pub type AptOstreeResult<T> = Result<T, AptOstreeError>;

// TODO: Implement proper OSTree error conversion when needed
// impl From<ostree::Error> for AptOstreeError {
//     fn from(err: ostree::Error) -> Self {
//         AptOstreeError::Ostree(err.to_string())
//     }
// }
