canic-core 0.26.10

Canic — a canister orchestration and management toolkit for the Internet Computer
Documentation
pub mod cycles;
pub mod env;
pub mod log;
pub mod placement;
pub mod pool;
pub mod topology;
pub mod upgrade;

use crate::{InternalError, domain::DomainError};
use thiserror::Error as ThisError;

///
/// PolicyError
///

#[derive(Debug, ThisError)]
pub enum PolicyError {
    #[error(transparent)]
    EnvPolicy(#[from] env::EnvPolicyError),

    #[error(transparent)]
    PoolPolicy(#[from] pool::PoolPolicyError),

    #[error(transparent)]
    TopologyPolicy(#[from] topology::TopologyPolicyError),

    #[error(transparent)]
    ScalingPolicy(#[from] placement::scaling::ScalingPolicyError),
}

impl From<PolicyError> for InternalError {
    fn from(err: PolicyError) -> Self {
        DomainError::from(err).into()
    }
}