Return error for non retryable errors
This commit is contained in:
parent
afb4b1b68f
commit
5a12e58c0c
@ -29,7 +29,7 @@ func Retry[T any](attempts int, sleep int, errorTypes []error, f func() (T, erro
|
||||
}
|
||||
result, err = f()
|
||||
if err == nil || !errorIsIn(err, errorTypes) {
|
||||
return result, nil
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
log.Errorf("Failed after %d attempts, last error: %s", attempts, err)
|
||||
|
Loading…
Reference in New Issue
Block a user