getFirstFailedSingleTransactionPlanResult
Retrieves the first failed transaction plan result from a transaction plan result tree.
This function searches the transaction plan result tree using a depth-first traversal and returns the first single transaction result with a 'failed' status. If no failed result is found, it throws a SolanaError.
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionPlanResult | TransactionPlanResult | The transaction plan result tree to search. |
Returns
FailedSingleTransactionPlanResult
The first failed single transaction plan result.
Throws
Throws a SolanaError with code
SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_SINGLE_TRANSACTION_PLAN_RESULT_NOT_FOUND if no
failed transaction plan result is found. The error context contains a non-enumerable
transactionPlanResult property for recovery purposes.
Example
Retrieving the first failed result from a parallel execution.