Skip to content

Commit

Permalink
Log correct error on retry (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarsti authored Jun 30, 2024
1 parent 627ce96 commit 37e6604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/duneapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ func New(log *slog.Logger, cfg Config) (*client, error) { // revive:disable-line
yes, err2 := retryablehttp.DefaultRetryPolicy(ctx, resp, err)
if yes {
if resp == nil {
log.Warn("Retrying request to Dune API", "error", err)
log.Warn("Retrying request to Dune API", "error", err2)
} else {
log.Warn("Retrying request to Dune API", "statusCode", resp.Status, "error", err)
log.Warn("Retrying request to Dune API", "statusCode", resp.Status, "error", err2)
}
}
return yes, err2
Expand Down
4 changes: 2 additions & 2 deletions client/jsonrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func NewClient(log *slog.Logger, cfg Config) (*rpcClient, error) { // revive:dis
yes, err2 := retryablehttp.DefaultRetryPolicy(ctx, resp, err)
if yes {
if resp == nil {
log.Warn("Retrying request to RPC client", "error", err)
log.Warn("Retrying request to RPC client", "error", err2)
} else {
log.Warn("Retrying request to RPC client", "statusCode", resp.Status, "error", err)
log.Warn("Retrying request to RPC client", "statusCode", resp.Status, "error", err2)
}
}
return yes, err2
Expand Down

0 comments on commit 37e6604

Please sign in to comment.