[][src]Struct exonum::runtime::ExecutionError

pub struct ExecutionError { /* fields omitted */ }

Result of unsuccessful runtime execution.

An execution error consists of:

  • an error kind
  • call information (runtime ID and, if appropriate, CallSite where the error has occurred)
  • an optional description

Call information is added by the core automatically; it is impossible to add from the service code. It is possible to inspect the call info for an error that was returned by a service though.

The error kind and call info affect the blockchain state hash, while the description does not. Therefore descriptions are mostly used for developer purposes, not for interaction with users.

Methods

impl ExecutionError[src]

pub fn service(code: u8, description: impl Into<String>) -> Self[src]

Creates an execution error for use in service code.

pub fn to_match(&self) -> ErrorMatch[src]

Converts an error to a matcher. The matcher expect the exact kind and description of this error, and does not check any other error fields.

pub fn kind(&self) -> ErrorKind[src]

The kind of error that indicates in which module and with which code the error occurred.

pub fn description(&self) -> &str[src]

Human-readable error description. May be empty.

pub fn runtime_id(&self) -> Option<u32>[src]

Returns the ID of a runtime in which this error has occurred. If the runtime is not known (e.g., the error originates in the core code), returns None.

pub fn call_site(&self) -> Option<&CallSite>[src]

Returns the call site of the error.

Trait Implementations

impl BinaryValue for ExecutionError[src]

impl Clone for ExecutionError[src]

impl Debug for ExecutionError[src]

impl<'de> Deserialize<'de> for ExecutionError[src]

impl Display for ExecutionError[src]

impl Error for ExecutionError[src]

impl From<ArtifactReqError> for ExecutionError[src]

impl From<CommonError> for ExecutionError[src]

impl From<CoreError> for ExecutionError[src]

impl From<InitMigrationError> for ExecutionError[src]

impl PartialEq<ErrorMatch> for ExecutionError[src]

impl PartialEq<ExecutionError> for ErrorMatch[src]

impl ProtobufConvert for ExecutionError[src]

type ProtoStruct = ExecutionError

Type generated from the Protobuf definition.

impl Serialize for ExecutionError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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