use crate::manifest::ManifestError;
use crate::sdk_version::SDKVersionError;
use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum ModuleInfoError {
#[error("the module doesn't contain section with '{0}', probably it's compiled with an old sdk version")]
NoCustomSection(&'static str),
#[error("the module contains {1} sections with name '{0}' - it's corrupted")]
MultipleCustomSections(&'static str, usize),
#[error("{0}")]
VersionError(#[from] SDKVersionError),
#[error("{0}")]
ManifestError(#[from] ManifestError),
#[error("provided Wasm file is corrupted: {0}")]
CorruptedWasmFile(anyhow::Error),
#[error("emitting resulted Wasm file failed with: {0}")]
WasmEmitError(anyhow::Error),
}