navi_plugin_runtime/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum RuntimeError {
5 #[error("WASM engine error: {0}")]
6 Engine(#[from] wasmtime::Error),
7
8 #[error("tool '{tool_name}' not found in plugin")]
9 ToolNotFound { tool_name: String },
10
11 #[error("fuel exhausted: plugin consumed all allocated fuel")]
12 FuelExhausted,
13
14 #[error("memory limit exceeded: plugin tried to allocate beyond {limit_mb} MB")]
15 MemoryLimitExceeded { limit_mb: u64 },
16
17 #[error("timeout: plugin exceeded {timeout_secs}s wall-clock limit")]
18 Timeout { timeout_secs: u64 },
19
20 #[error("output too large: {size_bytes} bytes exceeds {limit_bytes} bytes")]
21 OutputTooLarge {
22 size_bytes: usize,
23 limit_bytes: usize,
24 },
25
26 #[error("invalid input JSON: {0}")]
27 InvalidInput(String),
28
29 #[error("plugin returned error: {0}")]
30 PluginError(String),
31}