use crate::trap::RuntimeError;
use thiserror::Error;
pub use wasmer_artifact::{DeserializeError, ImportError, SerializeError};
#[derive(Error, Debug)]
#[error("Link error: {0}")]
pub enum LinkError {
#[error("Error while importing {0:?}.{1:?}: {2}")]
Import(String, String, ImportError),
#[error("RuntimeError occurred during linking: {0}")]
Trap(#[source] RuntimeError),
#[error("Insufficient resources: {0}")]
Resource(String),
}
#[derive(Error, Debug)]
pub enum InstantiationError {
#[error(transparent)]
Link(LinkError),
#[error("module compiled with CPU feature that is missing from host")]
CpuFeature(String),
#[error(transparent)]
Start(RuntimeError),
}