Struct exonum::blockchain::TransactionError
[−]
[src]
pub struct TransactionError { /* fields omitted */ }
Result of unsuccessful transaction execution encompassing both service and framework-wide error handling.
Notes:
- Content of
description
' field is excluded from hash calculation (seeStorageValue
implementation for the details). TransactionErrorType::Panic
is set by the framework if panic is raised during transaction execution.TransactionError
implementsDisplay
which can be used for obtaining a simple error description.
Examples
use exonum::blockchain::Schema; let schema = Schema::new(&snapshot); if let Some(result) = schema.transaction_results().get(&transaction_hash) { match result { Ok(()) => println!("Successful transaction execution"), Err(transaction_error) => { // Prints user friendly error description. println!("Transaction error: {}", transaction_error); } } }
Methods
impl TransactionError
[src]
pub fn error_type(&self) -> TransactionErrorType
[src]
Returns error type of this TransactionError
instance.
pub fn description(&self) -> Option<&str>
[src]
Returns an optional error description.
Trait Implementations
impl Debug for TransactionError
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for TransactionError
[src]
fn clone(&self) -> TransactionError
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for TransactionError
[src]
fn eq(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests for !=
.
impl Eq for TransactionError
[src]
impl PartialOrd for TransactionError
[src]
fn partial_cmp(&self, __arg_0: &TransactionError) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &TransactionError) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for TransactionError
[src]
fn cmp(&self, __arg_0: &TransactionError) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Display for TransactionError
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl From<ExecutionError> for TransactionError
[src]
fn from(error: ExecutionError) -> Self
[src]
Performs the conversion.