Show / Hide Table of Contents

Class TransactionException

Thrown when a transaction reached consensus and failed: the network processed it and charged its fee, and nothing else changed. Record lookups also throw it when the node cannot return the record; then the receipt is a stand-in carrying the lookup's status, not a verdict on the transaction (see the remarks).

Inheritance
object
Exception
TransactionException
Implements
ISerializable
Inherited Members
Exception.GetBaseException()
Exception.GetType()
Exception.ToString()
Exception.Data
Exception.HelpLink
Exception.HResult
Exception.InnerException
Exception.Message
Exception.Source
Exception.StackTrace
Exception.TargetSite
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.ReferenceEquals(object, object)
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class TransactionException : Exception, ISerializable
Remarks

Unlike PrecheckException, a TransactionException means the transaction did reach consensus and fees were charged, but the resulting status indicates failure: nothing else changed. The full receipt — including the exchange rate at the time of execution — is available via Receipt.

When the node has no receipt to give, the outcome is unknown and a ConsensusException is thrown instead, so a TransactionException from a transaction method is always a verdict. The record lookups (GetTransactionRecordAsync(ConsensusClient, TransactionId, CancellationToken, Action<IConsensusContext>?) and its kin) also throw it when the node cannot return the record; then Receipt is a stand-in carrying the query's status, not a verdict on the transaction.

Common permanent failures: InsufficientAccountBalance, InvalidSignature, AccountDeleted, TokenNotAssociatedToAccount. These indicate a configuration or state error — do not retry.

Suppression: set IConsensusContext.ThrowIfNotSuccess = false to prevent this exception from being thrown. When suppressed, the caller is responsible for inspecting receipt.Status on every returned receipt: only Success is known to have executed, and Unknown or ReceiptNotFound means the outcome is unknown: no verdict was returned. A ReceiptNotFound receipt is a stand-in carrying the node's answer, since the node had none to give.

Properties

| Edit this page View Source

Receipt

The underlying receipt returned from the network that caused the exception (or, from a record lookup the node could not answer, a stand-in carrying the query's status.)

Declaration
public TransactionReceipt Receipt { get; }
Property Value
Type Description
TransactionReceipt
| Edit this page View Source

Status

The status of Receipt: the consensus verdict when thrown by a transaction method, or the query's status when thrown by a record lookup with a stand-in receipt.

Declaration
public ResponseCode Status { get; }
Property Value
Type Description
ResponseCode
| Edit this page View Source

TransactionId

The Transaction ID generated by the library (or client code) identifying the request.

Declaration
public TransactionId TransactionId { get; }
Property Value
Type Description
TransactionId

Implements

ISerializable
  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph