1use thiserror::Error;
4
5#[derive(Debug, Error)]
7#[non_exhaustive]
8pub enum WasmError {
9 #[error("wasm parse / validation failure: {0}")]
11 InvalidWasm(String),
12
13 #[error("wasm instantiation failed: {0}")]
15 Instantiate(String),
16
17 #[error("wasm invoke failed: {0}")]
19 Invoke(String),
20
21 #[error("arrow IPC at wasm boundary: {0}")]
23 Ipc(#[from] uni_plugin_wasm_rt::IpcError),
24
25 #[error("wasm plugin exceeded resource limit: {0}")]
27 ResourceLimit(String),
28
29 #[error("uni-plugin-wasm internal error: {0}")]
31 Internal(String),
32
33 #[error("plugin abi {requested} unsupported; host majors: {supported:?}")]
37 AbiUnsupported {
38 requested: String,
40 supported: Vec<u64>,
42 },
43}
44
45impl uni_plugin_wasm_rt::pool::PoolResourceLimit for WasmError {
46 fn resource_limit(msg: String) -> Self {
47 Self::ResourceLimit(msg)
48 }
49}