use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum BuilderError {
#[error("invalid manifest path `{0}`")]
InvalidManifestPath(PathBuf),
#[error("please add \"rlib\" to [lib.crate-type]")]
InvalidCrateType,
#[error("cargo command run failed: {0}")]
CargoRunFailed(String),
#[error("unable to find the root package in cargo metadata")]
RootPackageNotFound,
#[error("WASM module does't contain export section `{0}`")]
ExportSectionNotFound(PathBuf),
#[error(
"WASM module doesn't contain required export funtions (init/handle) after optimized `{0}`"
)]
RequiredExportFnNotFound(PathBuf),
}