ayun-core 0.24.0

The RUST Framework for Web Rustceans.
Documentation
#[derive(thiserror::Error, Debug)]
pub enum ContainerError {
    #[cfg(feature = "anyhow")]
    #[error(transparent)]
    Anyhow(#[from] anyhow::Error),

    #[error(transparent)]
    Box(#[from] crate::BoxError),

    #[error("[instance] `{instance}` boot failed: {source}")]
    Boot {
        instance: String,
        #[source]
        source: Box<Self>,
    },

    #[error("[instance] `{instance}` clean failed: {source}")]
    Clean {
        instance: String,
        #[source]
        source: Box<Self>,
    },

    #[cfg(feature = "eyre")]
    #[error(transparent)]
    Eyre(#[from] eyre::Report),

    #[error("{0}")]
    Message(String),

    #[error("[instance] `{instance}` register failed: {source}")]
    Register {
        instance: String,
        #[source]
        source: Box<Self>,
    },

    #[error("[instance] `{instance}` not registered")]
    Resolve { instance: String },
}

impl ContainerError {
    pub fn message(msg: impl Into<String>) -> Self {
        Self::Message(msg.into())
    }
}