Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
c46a7221
Commit
c46a7221
authored
2 years ago
by
Subhan Shah
Browse files
Options
Downloads
Patches
Plain Diff
#34
Update errors.IsRetryableError to explicitly check and return false for any 400 errors.
parent
697404cb
No related branches found
No related tags found
1 merge request
!36
Resolve "Cater for errors being nil and update checks for retryable errors"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
errors/error.go
+7
-1
7 additions, 1 deletion
errors/error.go
with
7 additions
and
1 deletion
errors/error.go
+
7
−
1
View file @
c46a7221
...
...
@@ -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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment