Skip to content
Snippets Groups Projects
Commit c46a7221 authored by Subhan Shah's avatar Subhan Shah
Browse files

#34 Update errors.IsRetryableError to explicitly check and return false for any 400 errors.

parent 697404cb
Branches
Tags
1 merge request!36Resolve "Cater for errors being nil and update checks for retryable errors"
This commit is part of merge request !36. Comments created here will be created in the context of that merge request.
......@@ -9,6 +9,7 @@ import (
)
// CustomError implements the following interfaces:
//
// error
// github.com/pkg/errors: Cause
type CustomError struct {
......@@ -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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment