Skip to content

Commit

Permalink
Fix crashing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Feb 6, 2023
1 parent cd9d559 commit fd024ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func TryHTTPCall(ctx context.Context, numberOfTries uint64, operation func() (*h
}
if shouldRetry {
count = count + 1
return fmt.Errorf("retry %d due to HTTP %d: %w", count, resp.StatusCode, err)
httpCode := 0
if resp != nil {
httpCode = resp.StatusCode
}
return fmt.Errorf("retry %d due to HTTP %d: %w", count, httpCode, err)
}
return backoff.Permanent(fmt.Errorf("retry %d permanent: %w", count, err))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package internal

const (
LibraryVersion = "0.78.5"
LibraryVersion = "0.78.6"
)

0 comments on commit fd024ae

Please sign in to comment.