Skip to main content

RunError

Enum RunError 

Source
pub enum RunError {
    Discovery(DiscoveryError),
    Query {
        rule: String,
        language: String,
        detail: String,
    },
    MissingQuery {
        rule: String,
        language: String,
    },
    UnknownLanguage {
        rule: String,
        language: String,
        known: String,
    },
    WasmRuntime {
        detail: String,
    },
    Gates {
        rule: String,
        detail: String,
    },
    Component {
        rule: String,
        detail: String,
    },
    RunTimeout {
        budget: Duration,
        elapsed: Duration,
    },
    Rule {
        rule: String,
        file: String,
        detail: String,
    },
    Worker {
        detail: String,
    },
}
Expand description

Why a run could not complete.

Every variant aborts the run. A checker that could not finish must not be mistaken for one that found nothing — see architecture §6.8.

Variants§

§

Discovery(DiscoveryError)

Discovery could not run.

§

Query

A rule’s query does not compile.

Names the language as well as the rule: a rule holds one query per language it declares, so a position like query:3:12 locates a point in one of several sources, and only two of the compiler’s error kinds name the grammar themselves.

Fields

§rule: String

Which rule.

§language: String

Which language’s query, since a rule holds one per language.

§detail: String

The rendered compile error.

§

MissingQuery

A rule reached query compilation with no query for one of its languages.

Unreachable through config loading, which enforces the exact cover between a rule’s languages and its queries — so this is the engine’s own bookkeeping failing, named as such rather than dressed as a config error under an “invalid query” header.

Fields

§rule: String

Which rule.

§language: String

The language whose query the engine failed to carry.

§

UnknownLanguage

A rule names a language nothing provides.

Fields

§rule: String

Which rule.

§language: String

The language as written.

§known: String

What is available.

§

WasmRuntime

The WebAssembly runtime could not be described, so a run cannot be keyed against it.

Not about any rule. A cached result is only valid for the compilation environment it was produced under, and that environment is read off an engine built from lanekeep_wasm’s one configuration — so a host where wasmtime cannot realize it is a host where no result can be filed under a key that means anything. Guessing a value instead would put entries under a key describing nothing, which is the one failure docs/architecture.md §8.1 is arranged against.

What this costs, stated plainly: a host where wasmtime cannot build an engine can now run no rules at all — including a ruleset that is entirely TypeScript and needs no WebAssembly whatever. That is a real reduction in reach for no benefit until a component actually executes, and it is the price of keying every run against the environment rather than only the runs that use it. The alternative is a sentinel for “no wasm here”, which is a second code path through the cache key whose correctness nothing would exercise until the first component arrived. Worth revisiting if this ever fires on a real host; nothing has seen it fire, because the configuration is three tunables on a supported target.

Fields

§detail: String

What wasmtime said.

§

Gates

A rule’s gates are malformed.

Fields

§rule: String

Which rule.

§detail: String

What is wrong.

§

Component

A rule’s component could not be loaded, or could not be linked against the host world.

Separate from RunError::Rule, which is a rule that ran and failed. This one never ran: its bytes are missing, its import list reaches for something the sandbox does not grant, or its exports do not satisfy lanekeep:host’s rule world. All three are properties of the artifact rather than of any file, which is why there is no file field, and all three are found before a file is read.

Fields

§rule: String

Which rule.

§detail: String

What the component runtime said.

§

RunTimeout

The run’s wall-clock budget was spent, noticed between one file and the next.

The only limit breach that names no rule and no file, because it is about neither. Both engines already report a spent run budget from inside a handler — QuickJS from its interrupt handler, wasmtime from an epoch check compiled into guest code — and those arrive as RunError::Rule, carrying whichever rule happened to be executing. That is the right shape for a breach a rule was at least present for. It is the wrong shape for this one: nothing was executing, so there is no culprit to name and naming one would send a reader to a rule that is not the problem.

The wording is deliberately the same as both engines’, because the user-facing fact is the same and which mechanism noticed is lanekeep’s business rather than theirs.

Fields

§budget: Duration

The global budget.

§elapsed: Duration

How long the run had actually been going.

§

Rule

The sandbox failed, including on a breached budget.

Fields

§rule: String

Which rule.

§file: String

Which file it was running against.

§detail: String

The sandbox’s account of it.

§

Worker

A worker could not be set up.

Fields

§detail: String

What went wrong.

Trait Implementations§

Source§

impl Clone for RunError

Source§

fn clone(&self) -> RunError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunError

Source§

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

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

impl Display for RunError

Source§

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

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

impl Eq for RunError

Source§

impl Error for RunError

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<DiscoveryError> for RunError

Source§

fn from(source: DiscoveryError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RunError

Source§

fn eq(&self, other: &RunError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RunError

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ParallelSend for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = !

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.