1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pub(crate) type Result<T> = std::result::Result<T, Error>;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Initialization failed: {0}")]
InitializationFailed(Box<dyn std::error::Error + Send + Sync>),
#[error("Initialization failed: {0} init interrupted, execution deadline exceeded")]
InitializationFailedTimeout(String),
#[error("Guest call function (__guest_call) not exported by wasm module.")]
GuestCallNotFound,
#[error("WASI related parameter provided, but wasi feature is disabled")]
WasiDisabled,
#[error(transparent)]
Generic(#[from] anyhow::Error),
}
impl From<Error> for wapc::errors::Error {
fn from(e: Error) -> Self {
wapc::errors::Error::ProviderFailure(Box::new(e))
}
}