diff --git a/errors/error.go b/errors/error.go index bb14c1decab71c5f2429035d5d7899ee145815af..65ac2fd02793002e19de920f21f877fd6a741554 100644 --- a/errors/error.go +++ b/errors/error.go @@ -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 }