Skip to main content

AfterburnerError

Enum AfterburnerError 

Source
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.

Fields

§limit: usize
§

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.

Fields

§len: usize
§

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.

Fields

§tenant: Option<u32>
§retry_after_ms: u64
§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AfterburnerError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for AfterburnerError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for AfterburnerError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V