Skip to content

Commit

Permalink
Use error names instead of codes
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudhartert-db committed Nov 1, 2024
1 parent e9314bd commit 40a1b2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions httpclient/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func DefaultErrorMapper(ctx context.Context, resp common.ResponseWrapper) error
func DefaultErrorRetriable(ctx context.Context, err error) bool {
var httpError *HttpError
if errors.As(err, &httpError) {
if httpError.StatusCode == 429 {
if httpError.StatusCode == http.StatusTooManyRequests {
return true
}
if httpError.StatusCode == 504 {
if httpError.StatusCode == http.StatusGatewayTimeout {
return true
}
}
Expand Down

0 comments on commit 40a1b2a

Please sign in to comment.