use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum MemoryRegistryError {
#[error("composed memory admission rejected: {source}")]
Admission {
#[source]
source: Box<dyn std::error::Error + Send + Sync>,
},
#[error("memory admission is already registered")]
AdmissionAlreadyRegistered,
#[error("memory admission registration is sealed")]
AdmissionRegistrationSealed,
#[error("memory admission registry is poisoned")]
AdmissionRegistryPoisoned,
#[error("memory declaration rejected for stable key '{stable_key}': {reason}")]
InvalidDeclaration {
stable_key: String,
reason: &'static str,
},
#[error("memory host pool registration rejected: {reason}")]
PoolRegistration { reason: &'static str },
#[error(transparent)]
Pool(#[from] ic_memory::MemoryAllocationPoolError),
}