Skip to content

Commit 6992d83

Browse files
authored
fix(composer): include transaction processing errors in debug logging (#6)
Move `addSwapTransactions()` call inside the try/catch block in `execute()` so that errors during transaction processing (such as "Failed to process swap transaction at index X") are logged with comprehensive failure context via `logSwapExecutionFailure()` before being re-thrown to the developer's code. Previously, only errors from `atc.execute()` received debug logging, making it harder to diagnose intermittent transaction processing issues.
1 parent e14404e commit 6992d83

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/haystack/src/composer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ export class SwapComposer {
453453
txIds: string[]
454454
methodResults: ABIResult[]
455455
}> {
456-
// Auto-add swap transactions if needed (maintains backward compatibility)
457-
if (!this.swapTransactionsAdded) {
458-
await this.addSwapTransactions()
459-
}
460-
461456
try {
457+
// Auto-add swap transactions if needed (maintains backward compatibility)
458+
if (!this.swapTransactionsAdded) {
459+
await this.addSwapTransactions()
460+
}
461+
462462
const { txIDs, ...result } = await this.atc.execute(
463463
this.algodClient,
464464
waitRounds,

0 commit comments

Comments
 (0)