wasmtime_provider/
errors.rs1pub(crate) type Result<T> = std::result::Result<T, Error>;
7
8#[derive(thiserror::Error, Debug)]
10pub enum Error {
11 #[error("Initialization failed: {0}")]
13 InitializationFailed(String),
14
15 #[error("Initialization failed: {0} init interrupted, execution deadline exceeded")]
17 InitializationFailedTimeout(String),
18
19 #[error("Guest call function (__guest_call) not exported by wasm module.")]
21 GuestCallNotFound,
22
23 #[error("WASI related parameter provided, but wasi feature is disabled")]
25 WasiDisabled,
26
27 #[error("WASI context initialization failed: {0}")]
29 WasiInitCtxError(String),
30
31 #[error("Linker cannot register function '{func}': {err}")]
33 LinkerFuncDef {
34 func: String,
36 err: String,
38 },
39
40 #[error("Invalid WasmtimeEngineProviderBuilder configuration: {0}")]
42 BuilderInvalidConfig(String),
43
44 #[error(transparent)]
46 Wasmtime(#[from] wasmtime::Error),
47
48 #[error(transparent)]
50 Generic(#[from] anyhow::Error),
51}
52
53impl From<Error> for wapc::errors::Error {
54 fn from(e: Error) -> Self {
55 wapc::errors::Error::ProviderFailure(Box::new(e))
56 }
57}