Skip to main content

wasm_pvm/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3    #[cfg(feature = "compiler")]
4    #[error("WASM parsing error: {0}")]
5    WasmParse(#[from] wasmparser::BinaryReaderError),
6
7    #[error("Unsupported WASM feature: {0}")]
8    Unsupported(String),
9
10    #[error("Float operations are not supported by PVM")]
11    FloatNotSupported,
12
13    #[error("No exported function found")]
14    NoExportedFunction,
15
16    #[error("Function index {0} not found")]
17    FunctionNotFound(u32),
18
19    #[error("Unresolved import: {0}")]
20    UnresolvedImport(String),
21
22    #[error("Internal error: {0}")]
23    Internal(String),
24}
25
26pub type Result<T> = std::result::Result<T, Error>;