Skip to content

Commit

Permalink
Fix error handling for transaction traces
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Sep 19, 2024
1 parent d399673 commit 043c06e
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 043c06e

Please sign in to comment.