Skip to content
Snippets Groups Projects

Resolve "Cater for errors being nil and update checks for retryable errors"

Files

+ 7
1
@@ -9,6 +9,7 @@ import (
)
// CustomError implements the following interfaces:
//
// error
// github.com/pkg/errors: Cause
type CustomError struct {
@@ -251,7 +252,7 @@ func IsRetryableError(err error) bool {
if code == 0 {
return false
}
// 429 should always retry
if code == http.StatusTooManyRequests {
return true
@@ -262,5 +263,10 @@ func IsRetryableError(err error) bool {
return true
}
// Explicitly check for and return false for any 400s as well
if code >= 400 && code < 500 {
return false
}
return false
}
Loading