We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dc93b3 commit cca6febCopy full SHA for cca6feb
retry.go
@@ -79,13 +79,6 @@ func NotOnErrors(errs ...error) Condition {
79
// The error passed to the retry conditions will be the result
80
// of errors.Cause() on the original error from the run function.
81
func (r *Retry) Conditions(fns ...Condition) *Retry {
82
- for i, fn := range fns {
83
- fn := fn
84
- fns[i] = func(err error) bool {
85
- err = errors.Cause(err)
86
- return fn(err)
87
- }
88
89
r.appendPostConditions(fns...)
90
return r
91
}
@@ -107,6 +100,7 @@ func (r *Retry) preCheck() bool {
107
100
108
101
109
102
func (r *Retry) postCheck(err error) bool {
103
+ err = errors.Cause(err)
110
104
for _, fn := range r.postConditions {
111
105
if !fn(err) {
112
106
return false
0 commit comments