pub enum WasmError {
ModuleNotFound(String),
CompilationFailed(String),
InstantiationFailed(String),
GuestPanic(String),
Cancelled(String),
TypeConversion(String),
Io(String),
Config(String),
Timeout {
plugin: String,
timeout_secs: u64,
},
Trap {
plugin: String,
reason: TrapReason,
},
OutOfMemory {
plugin: String,
max_memory_bytes: u64,
},
Unhealthy {
plugin: String,
detail: String,
},
}Expand description
Errors that can occur during WASM plugin execution.
Variants§
ModuleNotFound(String)
CompilationFailed(String)
InstantiationFailed(String)
GuestPanic(String)
Cancelled(String)
TypeConversion(String)
Io(String)
Config(String)
Timeout
Trap
OutOfMemory
Unhealthy
Implementations§
Source§impl WasmError
impl WasmError
Sourcepub fn classify_trap(trap: &Trap) -> TrapReason
pub fn classify_trap(trap: &Trap) -> TrapReason
Classify a wasmtime Trap into a TrapReason.
Uses the trap type for well-known cases and falls back to message matching for epoch-related traps.
Note: wasmtime::Trap is #[non_exhaustive] — the other catch-all
arm is required and handles any future trap variants added by wasmtime.
Sourcepub fn plugin_name(&self) -> Option<&str>
pub fn plugin_name(&self) -> Option<&str>
Returns the plugin name associated with this error, if any.
Trait Implementations§
Source§impl Error for WasmError
impl Error for WasmError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for WasmError
? ergonomics for the bindgen trappable layer: when a generated
call_*(...) returns Result<_, wasmtime::Error> (the trappable wrapper
around a WIT result<_, _>), this impl lets ? convert the trap to
the canonical WasmError::GuestPanic (further classified later via
classify_error if more precision is needed).
impl From<Error> for WasmError
? ergonomics for the bindgen trappable layer: when a generated
call_*(...) returns Result<_, wasmtime::Error> (the trappable wrapper
around a WIT result<_, _>), this impl lets ? convert the trap to
the canonical WasmError::GuestPanic (further classified later via
classify_error if more precision is needed).
Auto Trait Implementations§
impl Freeze for WasmError
impl RefUnwindSafe for WasmError
impl Send for WasmError
impl Sync for WasmError
impl Unpin for WasmError
impl UnsafeUnpin for WasmError
impl UnwindSafe for WasmError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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