Skip to content

Commit

Permalink
Merge pull request #560 from onflow/fix-format-for-block-traces-v2
Browse files Browse the repository at this point in the history
Fix error handling for transaction traces
  • Loading branch information
sideninja authored Sep 19, 2024
2 parents d399673 + 043c06e commit 78467d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ func (d *DebugAPI) TraceBlockByNumber(
txTrace, err := d.TraceTransaction(ctx, h, nil)
if err != nil {
results[i] = &txTraceResult{TxHash: h, Error: err.Error()}
} else {
results[i] = &txTraceResult{TxHash: h, Result: txTrace}
}
results[i] = &txTraceResult{TxHash: h, Result: txTrace}
}

return results, nil
Expand All @@ -87,8 +88,9 @@ func (d *DebugAPI) TraceBlockByHash(
txTrace, err := d.TraceTransaction(ctx, h, nil)
if err != nil {
results[i] = &txTraceResult{TxHash: h, Error: err.Error()}
} else {
results[i] = &txTraceResult{TxHash: h, Result: txTrace}
}
results[i] = &txTraceResult{TxHash: h, Result: txTrace}
}

return results, nil
Expand Down

0 comments on commit 78467d5

Please sign in to comment.