Enum hedera::Error

source ·
#[non_exhaustive]
pub enum Error {
Show 21 variants TimedOut(Box<Error>), GrpcStatus(Status), FromProtobuf(Box<dyn StdError + Send + Sync + 'static>), FreezeUnsetNodeAccountIds, TransactionPreCheckStatus { status: Status, transaction_id: Box<TransactionId>, }, QueryPreCheckStatus { status: Status, transaction_id: Box<TransactionId>, }, QueryPaymentPreCheckStatus { status: Status, transaction_id: Box<TransactionId>, }, QueryNoPaymentPreCheckStatus { status: Status, }, BasicParse(Box<dyn StdError + Send + Sync + 'static>), BadEntityId { shard: u64, realm: u64, num: u64, present_checksum: Checksum, expected_checksum: Checksum, }, CannotCreateChecksum, KeyParse(Box<dyn StdError + Send + Sync + 'static>), KeyDerive(Box<dyn StdError + Send + Sync + 'static>), MnemonicParse { reason: MnemonicParseError, mnemonic: Mnemonic, }, MnemonicEntropy(MnemonicEntropyError), NoPayerAccountOrTransactionId, MaxQueryPaymentExceeded { max_query_payment: Hbar, query_cost: Hbar, }, NodeAccountUnknown(Box<AccountId>), ResponseStatusUnrecognized(i32), ReceiptStatus { status: Status, transaction_id: Option<Box<TransactionId>>, }, SignatureVerify(Box<dyn StdError + Send + Sync + 'static>),
}
Expand description

Represents any possible error from a fallible function in the Hedera SDK.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

TimedOut(Box<Error>)

Request timed out.

§

GrpcStatus(Status)

GRPC status code was an error.

§

FromProtobuf(Box<dyn StdError + Send + Sync + 'static>)

Failed to parse an SDK type from a protobuf response.

§

FreezeUnsetNodeAccountIds

Freeze failed due to there being no explicitly set node account IDs and no client being provided to generate them.

§

TransactionPreCheckStatus

A transaction failed pre-check.

The transaction had the ID transaction_id.

Caused by status being an error.

Fields

§status: Status

The status that caused the Transaction to fail pre-check.

§transaction_id: Box<TransactionId>

The TransactionId of the failed Transaction .

§

QueryPreCheckStatus

A Query for transaction_id failed pre-check.

Caused by status being an error.

Fields

§status: Status

The Status that caused the Query to fail pre-check.

§transaction_id: Box<TransactionId>

The associated transaction’s ID.

§

QueryPaymentPreCheckStatus

A Query failed pre-check.

The query had an associated PaymentTransaction with ID transaction_id.

Caused by status being an error.

Fields

§status: Status

The Status that caused the Query to fail pre-check.

§transaction_id: Box<TransactionId>

The associated PaymentTransaction’s TransactionId.

§

QueryNoPaymentPreCheckStatus

A Query failed pre-check.

The query had no PaymentTransaction.

Caused by status being an error.

Fields

§status: Status

The Status that caused the Query to fail pre-check.

§

BasicParse(Box<dyn StdError + Send + Sync + 'static>)

Failed to parse a basic type from string (ex. AccountId, ContractId, TransactionId, etc.).

§

BadEntityId

An entity ID had an invalid checksum

Fields

§shard: u64

The shard number

§realm: u64

The realm number

§num: u64

The entity number

§present_checksum: Checksum

The (invalid) checksum that was present on the entity ID

§expected_checksum: Checksum

The checksum that SHOULD HAVE BEEN on the entity ID

§

CannotCreateChecksum

An entity ID cannot be converted to a string with a checksum, because it is in an alternate form, such as an alias or evm_address

§

KeyParse(Box<dyn StdError + Send + Sync + 'static>)

Failed to parse a PublicKey or PrivateKey.

§

KeyDerive(Box<dyn StdError + Send + Sync + 'static>)

Failed to derive a PrivateKey from another PrivateKey.

Examples of when this can happen (non-exhaustive):

§

MnemonicParse

Failed to parse a Mnemonic due to the given reason.

the Mnemonic is provided because invalid Mnemonics can technically still provide valid PrivateKeys.

Fields

§reason: MnemonicParseError

This error’s source.

§mnemonic: Mnemonic

The Mnemonic in question.

§

MnemonicEntropy(MnemonicEntropyError)

An error occurred while attempting to convert a Mnemonic to a PrivateKey

§

NoPayerAccountOrTransactionId

The Client had no payer account (operator) and the attempted request had no explicit TransactionId.

§

MaxQueryPaymentExceeded

Cost of a Query is more expensive than max_query_payment.

The actual cost of the Query is query_cost.

Fields

§max_query_payment: Hbar

the configured maximum query payment.

§query_cost: Hbar

How much the query actually cost.

§

NodeAccountUnknown(Box<AccountId>)

The associated node account was not found in the network.

§

ResponseStatusUnrecognized(i32)

Received an unrecognized status code from the Hedera Network.

This can happen when the SDK is outdated, try updating your SDK.

§

ReceiptStatus

Getting the receipt for transaction_id failed with status.

Fields

§status: Status

The Error’s status code.

§transaction_id: Option<Box<TransactionId>>

The Transaction’s ID.

§

SignatureVerify(Box<dyn StdError + Send + Sync + 'static>)

Failed to verify a signature.

Trait Implementations§

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

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, request: &mut Request<'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<MnemonicEntropyError> for Error

source§

fn from(source: MnemonicEntropyError) -> Self

Converts to this type from the input type.
source§

impl From<Status> for Error

source§

fn from(source: Status) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !Freeze for Error

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
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 T
where 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.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

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

source§

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