mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-11-07 17:33:04 -08:00
rename Error to Err
This commit is contained in:
41 files changed
+118
-118
No files matched your search
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrorRetryFailed = errors.New("All retry attempts failed.")
|
||||
ErrRetryFailed = errors.New("All retry attempts failed.")
|
||||
)
|
||||
|
||||
// Strategy is a way to retry on a specific function.
|
||||
@@ -29,7 +29,7 @@ func (r *retryer) On(method func() error) error {
|
||||
}
|
||||
delay := r.NextDelay(attempt)
|
||||
if delay < 0 {
|
||||
return ErrorRetryFailed
|
||||
return ErrRetryFailed
|
||||
}
|
||||
<-time.After(time.Duration(delay) * time.Millisecond)
|
||||
attempt++
|
||||
|
||||
@@ -76,6 +76,6 @@ func TestRetryExhausted(t *testing.T) {
|
||||
})
|
||||
duration := time.Since(startTime)
|
||||
|
||||
assert.Error(err).Equals(ErrorRetryFailed)
|
||||
assert.Error(err).Equals(ErrRetryFailed)
|
||||
assert.Int64(int64(duration / time.Millisecond)).AtLeast(1900)
|
||||
}
|
||||
Reference in new issue
Block a user