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 stable key '{stable_key}' with id {id} violates namespace/range authority: {reason}"
)]
RangeAuthorityViolation {
stable_key: String,
id: u8,
reason: &'static str,
},
}