vc-runtime 0.1.0

Runtime backend for Visual Compiler
Documentation
//! Factory and registry errors.

use thiserror::Error;

#[non_exhaustive]
#[derive(Debug, Error)]
pub enum FactoryError {
    #[error("failed to build backend '{backend}': {source}")]
    BuildFailed {
        backend: String,
        #[source]
        source: anyhow::Error,
    },
}

impl FactoryError {
    /// Helper to create a BuildFailed error for a specific backend.
    pub fn backend(backend: impl Into<String>, source: impl Into<anyhow::Error>) -> Self {
        Self::BuildFailed { backend: backend.into(), source: source.into() }
    }
}