use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum MemoryRegistryError {
#[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,
},
#[error("memory layout ledger is corrupt: {reason}")]
LedgerCorrupt {
reason: &'static str,
},
}