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).
Implements
Inherited Members
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 SourceReceipt
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 |
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 |
TransactionId
The Transaction ID generated by the library (or client code) identifying the request.
Declaration
public TransactionId TransactionId { get; }
Property Value
| Type | Description |
|---|---|
| TransactionId |