use thiserror::Error;
#[derive(Debug, Error)]
pub enum WasmtimeRuntimeError {
#[error("failed to construct wasmtime engine: {0}")]
EngineInit(#[source] anyhow::Error),
#[error("failed to compile wasm module: {0}")]
ModuleCompile(#[source] anyhow::Error),
#[error("failed to instantiate module: {0}")]
InstantiateFailed(#[source] anyhow::Error),
#[error("module rejected at load time: {reason}")]
ModuleRejected { reason: String },
#[error("runtime probe failed for hook {hook}: {reason}")]
ProbeFailed { hook: &'static str, reason: String },
#[error("guest trap during {phase}: {source}")]
GuestTrap {
phase: &'static str,
#[source]
source: anyhow::Error,
},
#[error("pooling allocator saturated: {resource} limit reached ({limit})")]
PoolSaturated { resource: &'static str, limit: u32 },
}