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 (see StorageValue implementation for the details).
  • TransactionErrorType::Panic is set by the framework if panic is raised during transaction execution.
  • TransactionError implements Display 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]

[src]

Returns error type of this TransactionError instance.

[src]

Returns an optional error description.

Trait Implementations

impl Debug for TransactionError
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for TransactionError
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for TransactionError
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for TransactionError
[src]

impl PartialOrd for TransactionError
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[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]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Display for TransactionError
[src]

[src]

Formats the value using the given formatter. Read more

impl From<ExecutionError> for TransactionError
[src]

[src]

Performs the conversion.

Auto Trait Implementations