[−][src]Trait exonum::runtime::ExecutionFail
Trait representing an error type defined in the service or runtime code.
This trait can be derived from an enum using an eponymous derive macro from the exonum-derive
crate. Using such errors is the preferred way to generate errors in Rust services.
Examples
use exonum_derive::*; /// Error codes emitted by wallet transactions during execution: #[derive(Debug, ExecutionFail)] pub enum Error { /// Content hash already exists. HashAlreadyExists = 0, /// Unable to parse the service configuration. ConfigParseError = 1, /// Time service with the specified name does not exist. TimeServiceNotFound = 2, }
Required methods
fn kind(&self) -> ErrorKind
Extracts the error kind.
fn description(&self) -> String
Extracts the human-readable error description.
Provided methods
fn with_description(&self, description: impl Display) -> ExecutionError
Creates an error with an externally provided description. The default implementation
takes the description
as is; implementations can redefine this to wrap it in
an error-specific wrapper.