greentic_ext_runtime/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum RuntimeError {
5 #[error("extension '{0}' already loaded")]
6 AlreadyLoaded(String),
7
8 #[error("extension '{0}' not found")]
9 NotFound(String),
10
11 #[error(
12 "signature verification failed for extension '{extension_id}': {reason}\n\
13 hint: reinstall a signed extension (production), or rebuild ext-runtime \
14 with `--features dev-allow-unsigned` and set GREENTIC_EXT_ALLOW_UNSIGNED=1 (dev only)"
15 )]
16 SignatureInvalid {
17 extension_id: String,
18 reason: String,
19 },
20
21 #[error("contract error: {0}")]
22 Contract(#[from] greentic_extension_sdk_contract::ContractError),
23
24 #[error("wasmtime: {0}")]
25 Wasmtime(#[from] anyhow::Error),
26
27 #[error("io: {0}")]
28 Io(#[from] std::io::Error),
29
30 #[error("json: {0}")]
31 Json(#[from] serde_json::Error),
32
33 #[error("watcher: {0}")]
34 Watcher(String),
35
36 #[error("deploy extension error: {0}")]
37 Deploy(crate::types::DeployExtensionError),
38
39 #[error("permission denied: {0}")]
40 PermissionDenied(String),
41
42 #[error("extension error ({code}): {msg}", code = .0.code(), msg = .0)]
46 Extension(crate::types::HostExtensionError),
47}