pub enum Error {
Show 18 variants
Trap(Trap),
AbortOnPanic {
message: String,
},
BadReturnValue {
actual: Option<ValueType>,
},
ReturnedPtrOutOfRange {
pointer: u32,
size: u32,
memory_size: u32,
},
UnresolvedFunctionCalled {
function: String,
module_name: String,
},
ParamDecodeError,
ParamOutOfRange {
function: &'static str,
param_num: usize,
pointer: u32,
length: u32,
},
Utf8Error {
function: &'static str,
param_num: usize,
error: Utf8Error,
},
NoActiveTransaction,
FinishedWithPendingTransaction,
OutOfMemory {
function: &'static str,
requested_size: u32,
},
FreeError {
pointer: u32,
},
StateVersionMismatch {
parameter: TrieEntryVersion,
specification: TrieEntryVersion,
},
ChildStorageRootTrieDoesntExist,
BatchVerifyWithoutStarting,
AlreadyBatchVerify,
NoBatchVerify,
HostFunctionNotImplemented {
function: &'static str,
},
}Expand description
Reason why the Wasm blob isn’t conforming to the runtime environment.
Variants§
Trap(Trap)
Error in the Wasm code execution.
AbortOnPanic
Runtime has called the ext_panic_handler_abort_on_panic_version_1 host function.
BadReturnValue
A non-i64 value has been returned by the Wasm entry point.
ReturnedPtrOutOfRange
The pointer and size returned by the Wasm entry point function are invalid.
Fields
UnresolvedFunctionCalled
Called a function that is unknown to the host.
Note: Can only happen if
allow_unresolved_importswastrue.
Fields
ParamDecodeError
Failed to decode a SCALE-encoded parameter.
ParamOutOfRange
One parameter is expected to point to a buffer, but the pointer is out of range of the memory of the Wasm VM.
Fields
Utf8Error
One parameter is expected to point to a UTF-8 string, but the buffer isn’t valid UTF-8.
Fields
NoActiveTransaction
Called ext_storage_rollback_transaction_version_1 or
ext_storage_commit_transaction_version_1 but no transaction was in progress.
FinishedWithPendingTransaction
Execution has finished while a transaction started with
ext_storage_start_transaction_version_1 was still in progress.
OutOfMemory
Error when allocating memory for a return type.
Fields
FreeError
Called ext_allocator_free_version_1 with an invalid pointer.
StateVersionMismatch
Mismatch between the state trie version provided as parameter and the state trie version found in the runtime specification.
Fields
parameter: TrieEntryVersionThe version passed as parameter.
specification: TrieEntryVersionThe version in the specification.
ChildStorageRootTrieDoesntExist
Called ext_default_child_storage_root_version_1 or
ext_default_child_storage_root_version_2 on a child trie that doesn’t exist.
BatchVerifyWithoutStarting
Runtime has tried to perform a signature batch verification before initiating a batch verification.
AlreadyBatchVerify
Runtime has tried to initiate a batch signatures verification while there was already one in progress.
NoBatchVerify
Runtime has tried to finish a batch signatures verification while none is in progress.
HostFunctionNotImplemented
The host function isn’t implemented.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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