pub enum AfterburnerError {
Show 15 variants
CompileFailed(String),
ScriptNotFound,
FuelExhausted,
MemoryLimit,
Timeout,
WasmTrap(String),
Serialize(Error),
OutputTooLarge {
limit: usize,
},
UnexpectedRawOutput {
len: usize,
},
Host(String),
PermissionDenied(String),
RateLimited {
tenant: Option<u32>,
retry_after_ms: u64,
},
Overloaded,
ProcessExit(i32),
Engine(String),
}Expand description
Every failure mode Afterburner exposes to callers. Keep the set closed: callers match on it exhaustively.
Variants§
CompileFailed(String)
JS source failed to compile (syntax error, unsupported construct, etc.).
ScriptNotFound
thrust was invoked with a ScriptId the engine doesn’t know about.
Usually means the script was extinguished or never ignited.
FuelExhausted
The script consumed all fuel allotted by FuelGauge::fuel.
MemoryLimit
The script tried to allocate past FuelGauge::memory_bytes.
Timeout
Wall-clock FuelGauge::timeout_ms elapsed before the script finished.
WasmTrap(String)
The WASM runtime trapped for any reason not caught above (division by zero, unreachable, integer overflow, etc.).
Serialize(Error)
JSON could not be produced or consumed at the host boundary.
OutputTooLarge
The script’s result exceeded the per-call output ceiling
(FuelGauge::output_bytes, default 64 MiB). Applies uniformly
to the JSON result capture, raw result bytes, and script-mode
stdout. Surfaces as a typed error rather than an opaque
guest-side I/O trap or a JSON parse failure on truncated bytes.
UnexpectedRawOutput
The module returned raw bytes (Uint8Array / ArrayBuffer)
through a Value-shaped API (run / run_raw). Use the
OutputValue-returning variants (run_out / run_raw_out)
to receive raw results.
Host(String)
A host function returned an error to the script.
PermissionDenied(String)
The script requested a capability the active Manifold does not
grant (e.g. fs.readFileSync with FsAccess::None, or an FS
path outside the allowed roots). The inner string names the
denied operation - useful for audit logs and error messages.
RateLimited
The admission layer rejected this thrust because the associated
tenant’s token bucket is empty. Retry after retry_after_ms.
tenant is the raw u32 from TenantId (or None for the
unrestricted path). Callers can wrap back into TenantId if
they need the newtype.
Overloaded
The thrust engine refused the job because its global in-flight cap is reached (pooling-allocator slot exhaustion). This is a backpressure signal: slow down or provision more workers.
ProcessExit(i32)
The script called process.exit(n) inside daemon mode. The CLI
propagates the exit code to std::process::exit; library callers
can inspect the code and decide what to do.
Engine(String)
Generic engine-internal failure that doesn’t fit a specific variant. Use sparingly - prefer adding a typed variant.
Trait Implementations§
Source§impl Debug for AfterburnerError
impl Debug for AfterburnerError
Source§impl Display for AfterburnerError
impl Display for AfterburnerError
Source§impl Error for AfterburnerError
impl Error for AfterburnerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()