pub enum WasmError {
PointerMap,
Deserialize(Vec<u8, Global>),
Serialize(SerializedBytesError),
ErrorWhileError,
Memory,
GuestResultHandling(String),
Guest(String),
Host(String),
HostShortCircuit(Vec<u8, Global>),
Compile(String),
CallError(String),
}
Expand description
Enum of all possible ERROR codes that a Zome API Function could return.
Variants
PointerMap
while converting pointers and lengths between u64 and i64 across the host/guest we hit either a negative number (cannot fit in u64) or very large number (cannot fit in i64) negative pointers and lengths are almost certainly indicative of a critical bug somewhere max i64 represents about 9.2 exabytes so should keep us going long enough to patch wasmer if commercial hardware ever threatens to overstep this limit
Deserialize(Vec<u8, Global>)
These bytes failed to deserialize. The host should provide nice debug info and context that the wasm guest won’t have.
Serialize(SerializedBytesError)
Something failed to serialize. This should be rare or impossible for basically everything that implements Serialize.
ErrorWhileError
Somehow we errored while erroring. For example, maybe we failed to serialize an error while attempting to serialize an error.
Memory
Something went wrong while writing or reading bytes to/from wasm memory. this means something like “reading 16 bytes did not produce 2x WasmSize ints” or maybe even “failed to write a byte to some pre-allocated wasm memory” whatever this is it is very bad and probably not recoverable
GuestResultHandling(String)
Failed to take bytes out of the guest and do something with it. The string is whatever error message comes back from the interal process.
Guest(String)
Something to do with guest logic that we don’t know about
Host(String)
Something to do with host logic that we don’t know about
HostShortCircuit(Vec<u8, Global>)
Something to do with host logic that we don’t know about
AND wasm execution MUST immediately halt.
The Vec
Compile(String)
Somehow wasmer failed to compile machine code from wasm byte code
CallError(String)
Trait Implementations
impl<'de> Deserialize<'de> for WasmError
impl<'de> Deserialize<'de> for WasmError
fn deserialize<__D>(
__deserializer: __D
) -> Result<WasmError, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<WasmError, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Error for WasmError
impl Error for WasmError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl From<Infallible> for WasmError
impl From<Infallible> for WasmError
Allows ? in a TryFrom context downstream.
fn from(Infallible) -> WasmError
fn from(Infallible) -> WasmError
Converts to this type from the input type.
impl From<SerializedBytesError> for WasmError
impl From<SerializedBytesError> for WasmError
fn from(error: SerializedBytesError) -> WasmError
fn from(error: SerializedBytesError) -> WasmError
Converts to this type from the input type.
impl From<TryFromIntError> for WasmError
impl From<TryFromIntError> for WasmError
fn from(TryFromIntError) -> WasmError
fn from(TryFromIntError) -> WasmError
Converts to this type from the input type.
impl From<TryFromSliceError> for WasmError
impl From<TryFromSliceError> for WasmError
fn from(TryFromSliceError) -> WasmError
fn from(TryFromSliceError) -> WasmError
Converts to this type from the input type.
impl Ord for WasmError
impl Ord for WasmError
impl PartialOrd<WasmError> for WasmError
impl PartialOrd<WasmError> for WasmError
fn partial_cmp(&self, other: &WasmError) -> Option<Ordering>
fn partial_cmp(&self, other: &WasmError) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Serialize for WasmError
impl Serialize for WasmError
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'_> TryFrom<&'_ WasmError> for SerializedBytes
impl<'_> TryFrom<&'_ WasmError> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
fn try_from(t: &WasmError) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &WasmError) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
impl TryFrom<SerializedBytes> for WasmError
impl TryFrom<SerializedBytes> for WasmError
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
fn try_from(sb: SerializedBytes) -> Result<WasmError, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<WasmError, SerializedBytesError>
Performs the conversion.
impl TryFrom<WasmError> for SerializedBytes
impl TryFrom<WasmError> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
fn try_from(t: WasmError) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: WasmError) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
impl Eq for WasmError
impl StructuralEq for WasmError
impl StructuralPartialEq for WasmError
Auto Trait Implementations
impl RefUnwindSafe for WasmError
impl Send for WasmError
impl Sync for WasmError
impl Unpin for WasmError
impl UnwindSafe for WasmError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more