//! Error types for PlasmaVMC

use thiserror::Error;

/// PlasmaVMC error type
#[derive(Debug, Error)]
pub enum Error {
    /// VM not found
    #[error("VM not found: {0}")]
    VmNotFound(String),

    /// Image not found
    #[error("Image not found: {0}")]
    ImageNotFound(String),

    /// Node not found
    #[error("Node not found: {0}")]
    NodeNotFound(String),

    /// No suitable node for scheduling
    #[error("No suitable node for scheduling")]
    NoSuitableNode,

    /// Quota exceeded
    #[error("Quota exceeded: {0}")]
    QuotaExceeded(String),

    /// Hypervisor error
    #[error("Hypervisor error: {0}")]
    HypervisorError(String),

    /// Invalid state transition
    #[error("Invalid state: {0}")]
    InvalidState(String),

    /// Feature not supported by backend
    #[error("Unsupported feature: {0}")]
    UnsupportedFeature(String),

    /// Permission denied
    #[error("Permission denied")]
    PermissionDenied,

    /// Internal error
    #[error("Internal error: {0}")]
    Internal(String),
}

/// Result type for PlasmaVMC operations
pub type Result<T> = std::result::Result<T, Error>;
