pub enum Error {
Show 47 variants Interpreter(String), Storage(Error), BytesRepr(Error), NamedKeyNotFound(String), KeyNotFound(Key), AccountNotFound(Key), TypeMismatch(StoredValueTypeMismatch), InvalidAccess { required: AccessRights, }, ForgedReference(URef), URefNotFound(URef), FunctionNotFound(String), ParityWasm(Error), WasmOptimizer, GasLimit, Ret(Vec<URef>), Resolver(ResolverError), Revert(ApiError), AddKeyFailure(AddKeyFailure), RemoveKeyFailure(RemoveKeyFailure), UpdateKeyFailure(UpdateKeyFailure), SetThresholdFailure(SetThresholdFailure), SystemContract(Error), DeploymentAuthorizationFailure, ExpectedReturnValue, UnexpectedReturnValue, InvalidContext, IncompatibleProtocolMajorVersion { expected: u32, actual: u32, }, CLValue(CLValueError), HostBufferEmpty, UnsupportedWasmStart, NoActiveContractVersions(ContractPackageHash), InvalidContractVersion(ContractVersionKey), NoSuchMethod(String), WasmPreprocessing(PreprocessingError), KeyIsNotAURef(Key), UnexpectedStoredValueVariant, LockedContract(ContractPackageHash), InvalidContractPackage(ContractPackageHash), InvalidContract(ContractHash), InvalidContractWasm(ContractWasmHash), MissingArgument { name: String, }, DictionaryItemKeyExceedsLength, MissingSystemContractRegistry, MissingSystemContractHash(String), RuntimeStackOverflow, ValueTooLarge, MissingRuntimeStack,
}
Expand description

Possible execution errors.

Variants§

§

Interpreter(String)

WASM interpreter error.

§

Storage(Error)

Storage error.

§

BytesRepr(Error)

Failed to (de)serialize bytes.

§

NamedKeyNotFound(String)

Unable to find named key.

§

KeyNotFound(Key)

Unable to find a key.

§

AccountNotFound(Key)

Unable to find an account.

§

TypeMismatch(StoredValueTypeMismatch)

Type mismatch error.

§

InvalidAccess

Fields

§required: AccessRights

Required access rights of the operation.

Invalid access.

§

ForgedReference(URef)

Forged reference error.

§

URefNotFound(URef)

Unable to find a URef.

§

FunctionNotFound(String)

Unable to find a function.

§

ParityWasm(Error)

Parity WASM error.

§

WasmOptimizer

Error optimizing WASM.

§

GasLimit

Execution exceeded the gas limit.

§

Ret(Vec<URef>)

A stored smart contract incorrectly called a ret function.

§

Resolver(ResolverError)

Error using WASM host function resolver.

§

Revert(ApiError)

Reverts execution with a provided status

§

AddKeyFailure(AddKeyFailure)

Error adding an associated key.

§

RemoveKeyFailure(RemoveKeyFailure)

Error removing an associated key.

§

UpdateKeyFailure(UpdateKeyFailure)

Error updating an associated key.

§

SetThresholdFailure(SetThresholdFailure)

Error setting threshold on associated key.

§

SystemContract(Error)

Error executing system contract.

§

DeploymentAuthorizationFailure

Weight of all used associated keys does not meet account’s deploy threshold.

§

ExpectedReturnValue

Host buffer expected a value to be present.

§

UnexpectedReturnValue

Host buffer was not expected to contain a value.

§

InvalidContext

Error calling a host function in a wrong context.

§

IncompatibleProtocolMajorVersion

Fields

§expected: u32

Expected major version.

§actual: u32

Actual major version supplied.

Unable to execute a deploy with invalid major protocol version.

§

CLValue(CLValueError)

Error converting a CLValue.

§

HostBufferEmpty

Unable to access host buffer.

§

UnsupportedWasmStart

WASM bytes contains an unsupported “start” section.

§

NoActiveContractVersions(ContractPackageHash)

Contract package has no active contract versions.

§

InvalidContractVersion(ContractVersionKey)

Invalid contract version supplied.

§

NoSuchMethod(String)

Contract does not have specified entry point.

§

WasmPreprocessing(PreprocessingError)

Error processing WASM bytes.

§

KeyIsNotAURef(Key)

Unable to convert a Key into an URef.

§

UnexpectedStoredValueVariant

Unexpected variant of a stored value.

§

LockedContract(ContractPackageHash)

Error upgrading a locked contract package.

§

InvalidContractPackage(ContractPackageHash)

Unable to find a contract package by a specified hash address.

§

InvalidContract(ContractHash)

Unable to find a contract by a specified hash address.

§

InvalidContractWasm(ContractWasmHash)

Unable to find the WASM bytes specified by a hash address.

§

MissingArgument

Fields

§name: String

Name of the required argument.

Error calling a smart contract with a missing argument.

§

DictionaryItemKeyExceedsLength

Error writing a dictionary item key which exceeded maximum allowed length.

§

MissingSystemContractRegistry

Missing system contract registry.

§

MissingSystemContractHash(String)

Missing system contract hash.

§

RuntimeStackOverflow

An attempt to push to the runtime stack which is already at the maximum height.

§

ValueTooLarge

An attempt to write a value to global state where its serialized size is too large.

§

MissingRuntimeStack

The runtime stack is None.

Implementations§

source§

impl Error

source

pub fn type_mismatch(expected: CLType, found: CLType) -> Error

Returns new type mismatch error.

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

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

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

impl Display for Error

source§

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

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

impl Error for Error

1.30.0 · source§

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

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, demand: &mut Demand<'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<AddKeyFailure> for Error

source§

fn from(err: AddKeyFailure) -> Self

Converts to this type from the input type.
source§

impl From<CLValueError> for Error

source§

fn from(e: CLValueError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(_optimizer_error: OptimizerError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Option<ApiError>

source§

fn from(exec_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Option<Error>

source§

fn from(exec_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Option<Error>

source§

fn from(exec_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Option<Error>

source§

fn from(exec_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for StepError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<PreprocessingError> for Error

source§

fn from(error: PreprocessingError) -> Self

Converts to this type from the input type.
source§

impl From<RemoveKeyFailure> for Error

source§

fn from(err: RemoveKeyFailure) -> Self

Converts to this type from the input type.
source§

impl From<ResolverError> for Error

source§

fn from(err: ResolverError) -> Self

Converts to this type from the input type.
source§

impl From<RuntimeStackOverflow> for Error

source§

fn from(_: RuntimeStackOverflow) -> Self

Converts to this type from the input type.
source§

impl From<SetThresholdFailure> for Error

source§

fn from(err: SetThresholdFailure) -> Self

Converts to this type from the input type.
source§

impl From<UpdateKeyFailure> for Error

source§

fn from(err: UpdateKeyFailure) -> Self

Converts to this type from the input type.
source§

impl HostError for Error

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere Self: Into<T>,

Converts self into a target type. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Convert 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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync + 'static>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pipe for T

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more
§

impl<T> PipeAsRef for T

§

fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: AsRef<T>, T: 'a, R: 'a,

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
§

fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> Rwhere Self: AsMut<T>, T: 'a, R: 'a,

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
§

impl<T> PipeBorrow for T

§

fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: Borrow<T>, T: 'a, R: 'a,

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
§

fn pipe_borrow_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> Rwhere Self: BorrowMut<T>, T: 'a, R: 'a,

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
§

impl<T> PipeDeref for T

§

fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> Rwhere Self: Deref, R: 'a,

Pipes a dereference into a function that cannot normally be called in suffix position. Read more
§

fn pipe_deref_mut<'a, R>( &'a mut self, func: impl FnOnce(&'a mut Self::Target) -> R ) -> Rwhere Self: DerefMut, R: 'a,

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
§

impl<T> PipeRef for T

§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
§

fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more
source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap<F, R>(self, func: F) -> Selfwhere F: FnOnce(&Self) -> R,

Provides immutable access for inspection. Read more
§

fn tap_dbg<F, R>(self, func: F) -> Selfwhere F: FnOnce(&Self) -> R,

Calls tap in debug builds, and does nothing in release builds.
§

fn tap_mut<F, R>(self, func: F) -> Selfwhere F: FnOnce(&mut Self) -> R,

Provides mutable access for modification. Read more
§

fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere F: FnOnce(&mut Self) -> R,

Calls tap_mut in debug builds, and does nothing in release builds.
§

impl<T, U> TapAsRef<U> for Twhere U: ?Sized,

§

fn tap_ref<F, R>(self, func: F) -> Selfwhere Self: AsRef<T>, F: FnOnce(&T) -> R,

Provides immutable access to the reference for inspection.
§

fn tap_ref_dbg<F, R>(self, func: F) -> Selfwhere Self: AsRef<T>, F: FnOnce(&T) -> R,

Calls tap_ref in debug builds, and does nothing in release builds.
§

fn tap_ref_mut<F, R>(self, func: F) -> Selfwhere Self: AsMut<T>, F: FnOnce(&mut T) -> R,

Provides mutable access to the reference for modification.
§

fn tap_ref_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: AsMut<T>, F: FnOnce(&mut T) -> R,

Calls tap_ref_mut in debug builds, and does nothing in release builds.
§

impl<T, U> TapBorrow<U> for Twhere U: ?Sized,

§

fn tap_borrow<F, R>(self, func: F) -> Selfwhere Self: Borrow<T>, F: FnOnce(&T) -> R,

Provides immutable access to the borrow for inspection. Read more
§

fn tap_borrow_dbg<F, R>(self, func: F) -> Selfwhere Self: Borrow<T>, F: FnOnce(&T) -> R,

Calls tap_borrow in debug builds, and does nothing in release builds.
§

fn tap_borrow_mut<F, R>(self, func: F) -> Selfwhere Self: BorrowMut<T>, F: FnOnce(&mut T) -> R,

Provides mutable access to the borrow for modification.
§

fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: BorrowMut<T>, F: FnOnce(&mut T) -> R,

Calls tap_borrow_mut in debug builds, and does nothing in release builds.
§

impl<T> TapDeref for T

§

fn tap_deref<F, R>(self, func: F) -> Selfwhere Self: Deref, F: FnOnce(&Self::Target) -> R,

Immutably dereferences self for inspection.
§

fn tap_deref_dbg<F, R>(self, func: F) -> Selfwhere Self: Deref, F: FnOnce(&Self::Target) -> R,

Calls tap_deref in debug builds, and does nothing in release builds.
§

fn tap_deref_mut<F, R>(self, func: F) -> Selfwhere Self: DerefMut, F: FnOnce(&mut Self::Target) -> R,

Mutably dereferences self for modification.
§

fn tap_deref_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: DerefMut, F: FnOnce(&mut Self::Target) -> R,

Calls tap_deref_mut in debug builds, and does nothing in release builds.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into a target type. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more